Monday of the current week

  • Hello,

    Does anyone know how to get the Monday of the current week in a reporting services expression. I have found this that works ok in SQL DATEADD(week, DATEDIFF(week,0,getdate()), 0) however not in an expression.

    I need the DateFrom parameter to default to Mondy of the current week.

    Thankyou

    Kind Regards

    Nathan

  • Try this.

    =IIF(Weekday(Today())=1,DateAdd("D",1,Today()),

    IIF(Weekday(Today())=2,Today(),

    DateAdd("D",-1*(Weekday(Today())-2),Today())))

    It assumes Sunday as the first day of the week. If that is different from what you use, then you will need to change the format of the Weekday operator calls.

  • Using the same assumption as the previous poster (that on Sunday, Weekday(Today()) = 1), you can do this even more simply:

    =DateAdd("D",2-(Weekday(Today())),Today())

    Steve

    (aka smunson)

    :):):)

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

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

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