I recently did a report that had to be grouped quarterly (but NOT for the current calendar year). Crystal included starting at some version built-in functions for this but they only work with the CURRENT calendar year. Not all that handy. There are probably several approaches to this but this one finally became the solution. Group on this formula (Basic Syntax):
If Month( {TABLE.DATEFIELD} ) >= 1 AND Month ( {TABLE.DATEFIELD} ) <= 3 Then
Formula = "1ST QUARTER"
ElseIf Month( {TABLE.DATEFIELD} ) >= 4 AND Month ( {TABLE.DATEFIELD} ) <= 6 Then
Formula = "2ND QUARTER"
ElseIf Month( {TABLE.DATEFIELD} ) >= 7 AND Month ( {TABLE.DATEFIELD} ) <= 9 Then
Formula = "3RD QUARTER"
ElseIf Month( {TABLE.DATEFIELD} ) >= 10 AND Month ( {TABLE.DATEFIELD} ) <= 12 Then
Formula = "4TH QUARTER"
End If
By using the numeric as the first character of the group sort it comes out 1, 2, 3, 4. I tried creating 4 groups and several other approaches and none of them really worked except this one. I'd be interested to hear any other approaches though!
X!
If Month( {TABLE.DATEFIELD} ) >= 1 AND Month ( {TABLE.DATEFIELD} ) <= 3 Then
Formula = "1ST QUARTER"
ElseIf Month( {TABLE.DATEFIELD} ) >= 4 AND Month ( {TABLE.DATEFIELD} ) <= 6 Then
Formula = "2ND QUARTER"
ElseIf Month( {TABLE.DATEFIELD} ) >= 7 AND Month ( {TABLE.DATEFIELD} ) <= 9 Then
Formula = "3RD QUARTER"
ElseIf Month( {TABLE.DATEFIELD} ) >= 10 AND Month ( {TABLE.DATEFIELD} ) <= 12 Then
Formula = "4TH QUARTER"
End If
By using the numeric as the first character of the group sort it comes out 1, 2, 3, 4. I tried creating 4 groups and several other approaches and none of them really worked except this one. I'd be interested to hear any other approaches though!
X!