|
I need to sort a date group by a specific format. In the group options for a date field, you can choose how you want the section to be printed (by day, week, month, quarter...)
I need the group to be printed by week, but the week MUST be the first 7 days of the month as week 1, days 8-14 as week 2 and so on. Crystal defines a week as Sunday through Saturday, regardless of the dates. I tried to use the following formula as a group sort order: I get "A constant expression is required" error message.
if datepart('d',{rpSxData.DSampled}) IN 1 to 7 then "Week 1" else
if datepart('d',{rpSxData.DSampled}) IN 8 to 14 then "Week 2" else
if datepart('d',{rpSxData.DSampled}) IN 15 to 21 then "Week 3" else
if datepart('d',{rpSxData.DSampled}) IN 22 to 31 then "Week 4"
Is there a way to choose the above formula as the print order?
|
|
I do something similiar with month when I am trying to get reports done by fiscal year, in the order of October through September. I goto Group Expert, highlight the month, click Options, then I choose the second pull down menu and select in a specific order where I type in the order of the months that I want. Not sure if that will work for your issue but worth a try.
|