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
 varchar to Date conversion

Author  Topic 

qsjhaveri
Starting Member

2 Posts

Posted - 2008-05-30 : 07:16:22
I have Field which contains Date in dd/mm/yy fromat. I need to convert it into DateTime format so that it can be processed.

Please help

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2008-05-30 : 07:27:31
set dateformat 'dmy'
select convert(datetime, '30/05/2008')

EDIT:
I just re-read your post...What datatype is the column? If it represents a date it should be datetime or smalldatetime.

What application will "process" this value? If it is sql server then leave it as datetime. Even if it is not sql server then it is still likely that you can leave it as datetime. If you absolutely need to a string value, then what specific format do you need it in.


Be One with the Optimizer
TG
Go to Top of Page

qsjhaveri
Starting Member

2 Posts

Posted - 2008-05-30 : 08:39:15
Thanks a million... Work Done
Go to Top of Page
   

- Advertisement -