Click here to Skip to main content
16,012,223 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to convert date dd mm yyyy string to datetime in sql server 2005?
Posted

1 solution

Hi,

find the query below

SQL
SELECT CONVERT(DATETIME, REPLACE('06 06 2014',' ','/'))


hope this will help you.
 
Share this answer
 
Comments
Rahul 105 6-Jun-14 2:59am    
I am having date as varchar in dd-mm-yyyy format. Also I ant to add 5 days too the same.
So how can i do this? If its in mm-dd-yyyy format dateadd will work. I want to change dd-mm-yyyy to mm-dd-yyyy format(all varchars)first and then to datetime.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900