Day of week expression for parameter

  • I have a sales quotes report and want the report to run for quotes entered 2 working days ago. I have used a default date-time parameter in the past to do something similar for another report. I will be running the report daily and elivering by subscrition, so the parameter needs to be part of the report. In this case, I want the expression to evaluate what day of the week it is today and calculate what the date was 2 working days ago. For example:

    If today is Monday, then get last Thursday's date = today -4 days.

    If today is Tuesday, then use the range Friday to Sunday (in case anything is entered over the weekend) = -4 to -2 days.

    If today is Wednesday, then get Monday's date = today -2 days.

    If today is Thursday, then get Tuesday's date = today -2 days.

    If today is Friday, then get Wednesday's date = today -2 days.

    Can anybody help me - I'm struggling with how to use the date functions like this?

    Thanks!

  • Use this expression:

    = IIF(WeekDay(Globals!ExecutionTime)-1>2, DateAdd("d", -2,Globals!ExecutionTime), DateAdd("d", -4,Globals!ExecutionTime))

    Hope this will help

  • Thanks for yor help!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply