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
 SQL Server Development (2000)
 varchar to date

Author  Topic 

yahya
Starting Member

1 Post

Posted - 2011-08-04 : 04:14:03
hello i m using sql server 2008 i am having a problem with one of my column . i have a coulumn date_created which have data type of varchar(10)
when i use this coulmn in any where condition it does not give proper result . i.e if i use date<date_created , it doesnt identify the value in date_created .
how can i convert this varchar data type to date .

waiting for reply

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-08-04 : 04:45:30
you can use CONVERT() or CAST() to convert to date. Depending on the date format in string, you specify the style accordingly.

Refer to this http://msdn.microsoft.com/en-us/library/ms187928.aspx


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -