Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,


How to get the current date in this format (eg:15-August-2012)
Posted

Hi prakash,

see reference

Sql Date Formates[^]
 
Share this answer
 
Comments
prakash.chakrala 15-May-13 5:15am    
hi its not meeting my requirement.
Try the following Query
Quote:
SELECT convert(varchar(12), getdate(), 106)
 
Share this answer
 
SQL
SELECT CAST(DAY(GETDATE()) AS VARCHAR(2)) + ' ' + DATENAME(MM, GETDATE()) + ' ' + CAST(YEAR(GETDATE()) AS VARCHAR(4)) AS [DD Month YYYY]


try this query.it will return according to ur need...
 
Share this answer
 
v2
Comments
Bojjaiah 15-May-13 5:39am    
exactly... :) 5+
[no name] 15-May-13 5:39am    
If it helps..accept the solution..:)
[no name] 15-May-13 5:43am    
@Bojjaiah:Thanks....
prakash.chakrala 15-May-13 8:26am    
Actually this is my requirement

SELECT CAST(DAY(GETDATE()) AS VARCHAR(2)) + '-' + DATENAME(MM, GETDATE()) + '-' + CAST(YEAR(GETDATE()) AS VARCHAR(4)) AS [DD Month YYYY]
[no name] 15-May-13 8:30am    
Bit modification expected from your side also..our job is to give u closest solutions...accept my solution if it helped..

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