hpram99 Posted July 1, 2008 Report Share Posted July 1, 2008 I'm drawing a blank, what would be the best method for finding the Day and Month of the first day (Saturday) of the current week (regardless of what day of the week it really is) A big issue is what about today? July 1st Start of the week is June 29th... how do we get the correct month AND day? I'd imagine it would be something along the lines of get month get day something to find out what day of the week it is (perhaps using some sort of divisor of 356?) if difference of day and startingday < 0 then month = month - 1 something to find how many days in last month subtract difference from days to get correct date. help! Quote Link to comment Share on other sites More sharing options...
rberq Posted July 1, 2008 Report Share Posted July 1, 2008 Under Text, there is a Date command that allows you to put today's day name into a text variable. The same Date command allows you to set DD (day of the month) back x number of days from today's date. Unfortunately when setting DD into the past, the command does not accept a variable so you will have to use a CASE or a series of IFs to do the setback. So first, Save Day Of Week 2 (format MON, TUE, etc.) into T1 Then, If T1 = "MON" Save DD into T2 (with 1 day setback into the past) End If If T1 = "TUE" Save DD into T2 (with 2 day setback into the past) End If If T1 = "WED" Save DD into T2 (with 3 day setback into the past) End If etc. Copy and paste below. <Day of Week 2{NP000}{P000}01><IFVAR2:1:01:1:MON><DD{NP001}{P000}02><ENDIF><IFVAR2:1:01:1:TUE><DD{NP002}{P000}02><ENDIF><IFVAR2:1:01:1:WED><DD{NP003}{P000}02><ENDIF><TBOX4:T:1:CenterCenter000278000200:000:Day%T2%> Quote Link to comment Share on other sites More sharing options...
hpram99 Posted July 2, 2008 Author Report Share Posted July 2, 2008 Under Text, there is a Date command that allows you to put today's day name into a text variable. The same Date command allows you to set DD (day of the month) back x number of days from today's date. Unfortunately when setting DD into the past, the command does not accept a variable so you will have to use a CASE or a series of IFs to do the setback. So first, Save Day Of Week 2 (format MON, TUE, etc.) into T1 Then, If T1 = "MON" Save DD into T2 (with 1 day setback into the past) End If If T1 = "TUE" Save DD into T2 (with 2 day setback into the past) End If If T1 = "WED" Save DD into T2 (with 3 day setback into the past) End If etc. Copy and paste below. <Day of Week 2{NP000}{P000}01><IFVAR2:1:01:1:MON><DD{NP001}{P000}02><ENDIF><IFVAR2:1:01:1:TUE><DD{NP002}{P000}02><ENDIF><IFVAR2:1:01:1:WED><DD{NP003}{P000}02><ENDIF><TBOX4:T:1:CenterCenter000278000200:000:Day%T2%> Holy moly! I'm finding more and more I need to write K.I.S.S. all over my cubicle walls. Thanks a bunch! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.