AnsweredAssumed Answered

Case Function query...

Question asked by symbister on May 13, 2012
Latest reply on May 13, 2012 by symbister

Title

Case Function query...

Post

Hi

Trying to set up a button to report on a previous week's attendances, so that no matter when it is run, it reports on Tuesday-Sunday. OK got the report running OK, with hard coded dates, but attempting a scripted step to set a variable to an 'offset', which will then be subtracted from today's DayOfYear, to give last Tuesday's DOY...

but why doesn't this work? I've tried it in a set global variable script step, and tried it in a calculation field to set up a global value...

Case (DayName ( Get ( CurrentDate ) = "Monday"); 6 ; DayName ( Get ( CurrentDate )  = "Tuesday") ; 7 ; DayName ( Get ( CurrentDate )  = "Wednesday") ; 8 ;  DayName ( Get ( CurrentDate )  = "Thursday") ; 9 ; DayName ( Get ( CurrentDate )  = "Friday") ; 10 ; DayName ( Get ( CurrentDate )  = "Saturday") ; 11 ; DayName ( Get ( CurrentDate )  = "Sunday") ; 12 ; 0 )

Then the table has a calculation field to return DOY for the Creation Date, and this is used in the Find.

all ideas welcome

 

Outcomes