Thread: Calc Date - Mon of current week (2003)

1. Calc Date - Mon of current week (2003)

Hi Macropod
I like to calculate the date of Monday of the current week so when I invoice any day (e.g. Wed or Fri) of the week I can add "Invoice for Week of: {date}" to the body of the text.

Hope you can help.

Juergen

2. Re: Calc Date - Mon of current week (2003)

Hi Juergen,

If you check out my Date Calc 'tutorial'in <post#=249902>post 249902</post#>, you'll find an example for calculating a stepped date range. You can modify that to suit - the current example is set up to return Sundays, but instructions are given on how to change the code for other days. For your purposes, simply change the 'Weekday' value to -7. That should be sufficient to return the Monday of the current week, rather than the next Monday.

You might also want to change the 'DATE' expression to 'CREATEDATE' or 'SAVEDATE', depending on whether you're adding the field to a template or a document.

Cheers

3. Re: Calc Date - Mon of current week (2003)

Thanks for the quick answer, problem is "something strange happened on the way to the forum".
I am attaching a file with different weekdays, maybe you can shed some light on it. What am I missing?

Juergen

4. Re: Calc Date - Mon of current week (2003)

Macropod's formulas are intended for systems using DMY date format. As noted in the Introductory Notes, Date input/output formats section, they have to be modified for systems using MDY date format:
- Press Alt+F9 to display field codes.
- Change all instances of dd*10^6+mm*10^4+yy to mm*10^6+dd*10^4+yy
- Press Alt+F9 to hide field codes.
- Select all fields and press F9 to update them.

5. Re: Calc Date - Mon of current week (2003)

Thanks, that put me on the right track. Incidently, the Weekday number needs to be 0 (zero), not -7, for the previous Monday.

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•