How to find the previous week

656 views
Skip to first unread message

Reginald Bailly

unread,
Oct 24, 2014, 3:42:25 PM10/24/14
to multisoft...@googlegroups.com
What function would give the previous week from a date ?
today := date()                  // 10/24/2014

How to find the previous week from today .
1) need date of beginning of week
2) need date of end of week

Thanks for the support

Reginald

Paul

unread,
Oct 25, 2014, 6:19:28 AM10/25/14
to
Use standard DOW() FlagShip function. Here a short example:

 dCurr := date()          // current date
 dEoW  := dCurr -1        // start date = yesterday
 while dow(dEoW) != 7     // find previous end-of-week = Saturday
   dEoW --
 enddo
 dMonday := dEoW -5       // Saturday back to Monday
 ? "Today is",dCurr, "Saturday of last week was the",dEoW, "and Monday of last week was the",dMonday
 wait


Hope this helps you.
Paul
Reply all
Reply to author
Forward
0 new messages