Click here to Skip to main content
15,892,839 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi this anil
i have table inthat one columan name datetime and datatype is varchar(50)
i inserted a datetime value as mm/dd/yyyy hh:mm:ss
so now i want to retrieve date time value as yyyy-mm-dd hh:mm:ss
how to get a specific format i tried select convert(varchar(50),datetime,102) this type select query but am not getting right answer
Posted
Comments
Bernhard Hiller 6-Aug-13 4:26am    
"columan name datetime and datatype is varchar(50)" that deservces a downvote.

1 solution

Try:
SQL
SELECT CONVERT(NVARCHAR, GETDATE(), 120)
 
Share this answer
 
Comments
ridoy 5-Aug-13 15:36pm    
I think it is right,my 5!
Kuthuparakkal 5-Aug-13 23:34pm    
Yes 5+!

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