Click here to Skip to main content
15,892,643 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I want display date from table as 13-Mar-2013

My table date was : 2010-03-13

regards,
dev
Posted
Updated 12-Mar-13 20:59pm
v2

try this...
instead of getdate() function put your date value...
SQL
SELECT replace(CONVERT(VARCHAR(11), GETDATE(), 113),' ','-')

Happy Coding!
:)
 
Share this answer
 
v2
Comments
gvprabu 13-Mar-13 2:58am    
hi,
His requirement is Different format...
Aarti Meswania 13-Mar-13 3:05am    
right I have correct it
Davidduraisamy 13-Mar-13 3:00am    
Ya..Check the qusetion and rply properly Aarti
Aarti Meswania 13-Mar-13 3:05am    
I have correct it
Davidduraisamy 13-Mar-13 3:07am    
hmmm..
Use this:

SQL
SELECT replace(convert(varchar, getdate(), 106),' ','-')
 
Share this answer
 
v3
DateTime dtFrom = GetDateFromDataBase();
string date = GetDateFromDataBase().ToString("dd-MMM-yyyy");
 
Share this answer
 
Comments
Zoltán Zörgő 13-Mar-13 2:53am    
Read the question! Your answer is not usable directly in sql server.

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