How to know month name from month index in t-sql(praveenbattula.blogspot.com)
submitted by
praveenbattula(629) 1 year, 7 months ago
When I am working with reports, this is what every time I am looking for. Everyone gives date on the report as input, and I want display the month name on the report instead of month index [1-12]. So, how to do it?
please use the below script to get the name of the month by month index.
DateName(month, convert( datetime, '2007-' + cast(month(getdate()) as varchar(2)) + '-01', 120))
Here month(getdate()) returns the current month index from getdate() function. Hope this helps...
|category: Database
|Views: 0
tags:
Database another
Everyones tags:
Your Tags: