Please start any new threads on our new site at 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 

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

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

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

Go to Top of Page

- Advertisement -