I'm using CR8, the following formula gives me 3 date ranges based on the # of days in the "current period" (for example: current period 1 to 10 July 2008, prior period 22 Jun to 1 July 2008, and last year period 1 to 10 July 2007)
--------
({CRIMES_ALLV.DATEOCC} in dateadd("d",-(datediff("d",{?StartDate},{?EndDate})),{?StartDate})to{?StartDate}
or
{CRIMES_ALLV.DATEOCC} in dateadd("yyyy",-1,{?StartDate}) to Dateadd("yyyy",-1,{?EndDate})
or
{CRIMES_ALLV.DATEOCC} in {?StartDate} to{?EndDate})
--------
This part of the formula: ({CRIMES_ALLV.DATEOCC} in dateadd("d",-(datediff("d",{?StartDate},{?EndDate})),{?StartDate})to{?StartDate}
gives me the prior period 22 Jun to 1 July, but I need it to give me 21 Jun to 30 Jun (so that I'm not overlapping the 1 July date in my comparisons.
Any tips or clues out there?