Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Need to Convert to Timestamp Format

Author  Topic 

bhaasjoshi
Starting Member

17 Posts

Posted - 2009-09-18 : 02:20:35
Hi Friends,

I have dates in the following format '01-JAN-2009:13:30' (the variable is stored as a Character Data type. I need to convert it to TimeStamp format.

Currently I am using the following code which gives me an error,
TO_TIMESTAMP(VARIABLE,'DD-MON-YYYY:HH24:MI')

Please help.

Best Regards,
Bhaas

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-18 : 02:55:03
cast(VARIABLE as datetime)

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

bhaasjoshi
Starting Member

17 Posts

Posted - 2009-09-18 : 03:08:14
Thanks for your reply Madhivanan, but it doesnt work.

I'm using an application called Integrated Review, I think this application doesnt allow CAST().

Best Regards,
Bhaas
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-09-18 : 03:39:36
Then I think it is not a question for SQL Server forum.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -