Feb 28, 2001 #1 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.
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.
Feb 28, 2001 #2 Guest_imported New member Jan 1, 1970 0 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. Upvote 0 Downvote
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.
Feb 28, 2001 1 #3 kenhamady Instructor Sep 10, 2000 8,794 US 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 http://www.kenhamady.com/Crystal Reports Training/Consulting and a Quick Reference Guide to VB/Crystal (including ADO) Upvote 0 Downvote
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 http://www.kenhamady.com/Crystal Reports Training/Consulting and a Quick Reference Guide to VB/Crystal (including ADO)