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 2005 Forums
 Transact-SQL (2005)
 Convert varchar to Datetime

Author  Topic 

scven
Starting Member

5 Posts

Posted - 2007-05-22 : 04:46:49
I have got a table with a date column in format "dd/mm/yyyy". Currently a varchar.
How do i convert this column to a datetime

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-05-22 : 04:47:54
[code]
convert(datetime, @date_col, 103)
[/code]


KH

Go to Top of Page

scven
Starting Member

5 Posts

Posted - 2007-05-22 : 04:53:59
Thanks
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-05-22 : 05:10:40
Always use proper datatype DATETIME to store dates and let front end application do the formation

Madhivanan

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

- Advertisement -