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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 date time conversion

Author  Topic 

wotrac
Yak Posting Veteran

98 Posts

Posted - 2004-11-25 : 16:00:05
Hi

How do I convert the following string
26/11/04 to the datetime datatype.

NB. This is in the following format dd/mm/yy

scullee
Posting Yak Master

103 Posts

Posted - 2004-11-25 : 16:59:57
Have a look in books online about the convert function

but
declare @datevalue datetime
select @datevalue = CONVERT ( datetime , '26/11/04' ,3 )

If the year was four digits the format (end param) would be 103

Go to Top of Page

wotrac
Yak Posting Veteran

98 Posts

Posted - 2004-11-25 : 17:21:39
Thanks for the help

I managed to work it out for myself, just before you replied.
Go to Top of Page
   

- Advertisement -