Click here to Skip to main content
15,886,545 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hi,

I Have a date 13-11-2014
that is 13th Nov 2014

and i need to convert to 2014-11-13


Pls Help

Regards
Nirmala Devi
Posted
Comments
/\jmot 11-Nov-14 5:31am    
try this..
select CONVERT(varchar(50),cast('11/13/2014' as date),111)
Nirmala Saravanan 11-Nov-14 6:38am    
but i want result in 2014-11-13

check this Date conversion[^]
 
Share this answer
 
Comments
Ankur\m/ 11-Nov-14 4:59am    
I refer the same for datetime conversions. It's pretty comprehensive. 5!
Shweta N Mishra 11-Nov-14 5:02am    
thank you :)
Hi,
This link may be useful ..try

http://www.sql-server-helper.com/functions/date-and-time-functions/index.aspx[^]

Thanks,
Lok..
 
Share this answer
 
Hi,
check the link, All Date Formats Available


SQL
SELECT CONVERT(VARCHAR(10), GETDATE(), 120) AS [YYYY-MM-DD]
SELECT REPLACE(CONVERT(VARCHAR(10), GETDATE(), 111), '/', '-') AS [YYYY-MM-DD]
 
Share this answer
 

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