Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends..
i am saving date in the format dd/mm/yyyy
In database it shows in proper format(dd/mm/yyyy)
e.g 16/03/2010

But while retrieving i am getting it in format like dd-MM-yy
e.g 16-Mar-10

How can i get it in format like 16/03/2010?
Pleas help me
Posted

You can use CONVERT:
Here you go...
CAST and CONVERT[^]
How to format a Date or DateTime in SQL Server[^]
 
Share this answer
 
use convert function..

for dd/mm/yyyy format
SQL
SELECT CONVERT(VARCHAR, columnName, 103) AS Mydate From Table; 

for dd/mm/yy format
SQL
SELECT CONVERT(VARCHAR, columnName, 3) AS Mydate From Table;

msdn: Convert function[]

hope it helps
 
Share this answer
 
v2

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