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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to group by month only when the date field is MM/DD/YYYY

Status
Not open for further replies.

ZacharyR

IS-IT--Management
Feb 20, 2009
28
0
0
CA
Hi....I need to group records by month only, for all years. The records each have a date field that contains values in the MM/DD/YYYY format. I recognize that i need to use a formula as the group sort order to only grab the month value and ignore everything else

Example of how I want the grouping to look:

January
Apples 1/23/1998
Oranges 1/13/2003
Pears 1/21/2005
Bananas 1/08/2006

I was going to use the month function:

Month(x)

where X is the field in my database that has the date values. When I do this, CR returns a warning that "A constant expression is required here"

Can anyone lend a hand?

thanks

Zach
 
You should not be using the formula for sort order, but actually inserting your group on this formula, which should be created in the field explorer->formula->new area:

month({table.date})

-LB
 
great!...that fixed it..thanks

Zach
 
You can even use MonthName(Month({table.column})) to return the actual month name!

Remington Jarvis
remiWare LLC - remiCrystal Automation Tool
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top