How to know month name from month index in t-sql(praveenbattula.blogspot.com)

submitted by praveenbattulapraveenbattula(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...

add a comment |category: |Views: 0

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story