Page 1 of 1

string to timestamp conversion

Posted: Thu Sep 20, 2012 5:28 am
by marpadga18
HI All,
my source has a varchar column DATE with following data :
8/3/2012 12:00:00 AM

My target should be like this
2012-08-03 00:00:00

I tried with date conversions but not getting exact output any ideas really appreciated Thanks M

Posted: Thu Sep 20, 2012 5:45 am
by ray.wurlod
How about you show us what you tried, and tell us in what way you are not "getting exact output"?

Posted: Thu Sep 20, 2012 5:47 am
by marpadga18
StringToTimestamp(lnk_src_exl_onbase.DATE,"%(m,s)/%(d,s)/%yyyy%(H,s):%nn:%ss%aa")

Posted: Thu Sep 20, 2012 7:41 am
by chulett
So, that gets it to a timestamp. What is your target's data type? What output are you currently getting? If you need a particular format, convert it back to a string.