cancel
Showing results for 
Search instead for 
Did you mean: 

displaying dates of current month on every Sunday

Former Member
0 Kudos

i want to create 4 or 5 variables carrying dates on every sunday of current month. please help me with the farmula to build one such variable.

thanks

saqib

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Here are some formulas you can use:

//@FirstSunday

minimum(MonthToDate) + (if dayofweek(minimum(MonthToDate)) = 1 then 0 else (7 - dayofweek(minimum(MonthToDate)) + 1))

//@SecondSunday

dateadd("ww",1,{@FirstSunday})

//@ThirdSunday

dateadd("ww",2,{@FirstSunday})

//@FourthSunday

dateadd("ww",3,{@FirstSunday})

//@FifthSunday

if dateadd("ww",4,{@FirstSunday}) >= dateadd("m",1,minimum(monthtodate))

then date(1900,1,1)

else dateadd("ww",4,{@FirstSunday})

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Saquib,

If you want to display the date only if it is a Sunday then you can use the formula like this

If DayOfWeek(CurrentDate) = crSunday then CurrentDate ;

Please elaborate in detail if you are looking for something else like where you want to use this formula and in which section.

Regards