on 09-11-2008 2:31 AM
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
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})
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.