BusinessObjects Board

Crystal 2008 Help needed to understand a formula

I’m converting some Crystal 2008 reports to BOXI and would like a second opinion on what the following Record Selection criteria means.

I think it means, show the results between the most recent Saturday and the Saturday before that, any thoughts?


Record Selection:- 

{HPD_Help_Desk.Reported_Date} in {@Start} to {@End}

@Start definition:- 

numberVar modif := DayOfWeek (currentdate,crSaturday) +{?Backdate};
DateDiff ("s",#01/01/1970# ,(currentdate-modif));

@End definition:-

numberVar modif := DayOfWeek (currentdate,crSaturday) +{?Backdate};
DateDiff ("s",#01/01/1970# ,(currentdate+7-modif));

Paul Shovlar :uk: (BOB member since 2002-09-05)

In both formulas the calculation for modif does the following:

  1. Get the day of the week as a number for the current date, assuming that Saturday is the first day of the week.
  2. Add the result of step 1 to the value of the {?Backdate} parameter.

In the start formula, it then does this:

  1. Subtract the value of modif from the current date (results in a date.)
  2. Get the difference in seconds between that value and 1/1/1970.

In the end formula it does this:

  1. Add 7 days to the current date and subtract the value of modif.
  2. Get the difference in seconds between that value and 1/1/1970.

-Dell


hilfy :us: (BOB member since 2007-04-16)