Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting Month From date 1

Status
Not open for further replies.

Mammoth

IS-IT--Management
Feb 28, 2001
85
US
What would be the formula for creating a formula field to extract only the month from a date field so I can use it to sort by.
 
You have the function month() wich gives you the month of a date, this way: Month({your_date}).

Of course {your_date} is an example.
 
The Month() function returns a number 1-12.

sorting by this will be OK only if all the dates are in the same year. if not use the following formula:

year({field})*100 + Month({field})

This field can be sorted on, but shouldn't be displayed.


If you can use a group instead of sorting, there is an automatic option to group a date by week/month/quarter etc. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top