Page 1 of 1
String To Timestamp
Posted: Tue Mar 04, 2008 9:52 am
by reddy
Hi,
I have a datefield (01/25/2008) stored as a Varchar. I need to convert it into Timestamp 19 format with hh:mm:ss as 00:00:00. I went through different threads and tried different things. Everytime i get ***** as out put. Can anyone please help me? Thanks in advance.
Reddy.
Posted: Tue Mar 04, 2008 10:02 am
by ArndW
When column In.Datefield is '01/25/2008' then the derivation is
Code: Select all
StringToTimestamp(In.Datefield:' 00:00:00','%dd/%mm/%yyyy %hh:%nn:%ss')
Posted: Tue Mar 04, 2008 10:35 am
by reddy
I am able to convert 01/01/2008 to 2008-01-01 00:00:00 but surprisingly it returns ******* for 01/25/2008. Can anyone explain? Thanks.
reddy
Posted: Tue Mar 04, 2008 10:37 am
by reddy
I am able to convert 01/01/2008 to 2008-01-01 00:00:00 but surprisingly it returns ******* for 01/25/2008. Can anyone explain? Thanks.
reddy
Posted: Tue Mar 04, 2008 11:12 am
by ArndW
99% likely because your explicit (or implicit) mask starts off with %dd/%mm!
Posted: Tue Mar 04, 2008 12:24 pm
by reddy
Can you please tell me the solution for this problem? Thanks.
Reddy
Posted: Tue Mar 04, 2008 1:42 pm
by jmarutz
It's like ArndW said, your job/project format default settings have the timestamp format of day then month (%dd/%mm) You can either change them to be month then day (%mm/%dd) or you can explicitly state the format of your date field in the transformer like ArndW previously posted.