SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 varchar to date
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

yahya
Starting Member

Pakistan
1 Posts

Posted - 08/04/2011 :  04:14:03  Show Profile  Reply with Quote
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)

Singapore
17636 Posts

Posted - 08/04/2011 :  04:45:30  Show Profile  Reply with Quote
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
Time is always against us

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000