Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 257
  • Last Modified:

How to show months from a sql view

I have a view that shows invoicing data from the past through today's date.  I used a datepart function to seperate the month out from the date of the invoice, however, it comes out as 1 through 12.  Is there a way to get the month to show up as either March or Mar vs. 3?
Thanks,
JoMar
0
JoMar
Asked:
JoMar
3 Solutions
 
chapmandewCommented:
select datename(m, datefield)
from yourtable
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
check out DATENAME(month, yourdatefield) instead.
0
 
chapmandewCommented:
angelIII, are you suggesting that m in the datepart function doesn't work?  By the time difference of our responses I doubt that you are, just making sure.  :)
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
RemcovCCommented:
@chapmandew

The syntax is: DATENAME ( datepart , date )
and the datepart for a month can either be m, mm, month

see: http://msdn.microsoft.com/en-us/library/ms174395.aspx
0
 
JoMarAuthor Commented:
Thanks to all - I awarded the most points to chapmandew since his came in first and was correct.  I also awarded some to angellll since he had the same thing and was also correct.  And I awarded som to RemcovC for the syntax information.  Great job to all and thanks.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>angelIII, are you suggesting that m in the datepart function doesn't work?  
as you assumed, I was responding to the questioner, and had not seen your post until I posted...
0
 
chapmandewCommented:
RemcovC, Yes, I'm aware.  Thank you.  :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now