Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Jan 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    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
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. #3
    New Lounger
    Join Date
    Jan 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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
    Attached Files Attached Files

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    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. #5
    New Lounger
    Join Date
    Jan 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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
  •