Using TSQL, How to return a date with a format similar to “7-Feb-2012”?
this returns the day:
SELECT DATEPART(d, getdate())
this returns the year:
SELECT DATEPART(yyyy, getdate())
How to return the month name?
Thanks,
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The following will give you the format like “14-Feb-2012”:
If you just want the month name, you can do: