Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Jun 2004
    Location
    Whistler, Br. Columbia, Canada
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date-field formula to express added days by name

    I have a field {arrival} which is a date. I want to display {arrival+3}, expressed as a day of the week. So if {arrival} is a Friday, I want to be able to output "Monday" in my document. I tried { ={arrival \@ "dddd"} + 3} thinking that the days of the week would cycle at the end of month anyways but that gave me an "undefined bookmark" error.

    Help?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Some very interesting tutorials and samples posted by Paul (macropod) here:

    Word Date Calculation Tutorial (v2.85) (old links don't work, but the attachment is still available)

    Word Field Maths Tutorial (v1.4)

  3. #3
    Lounger
    Join Date
    Jun 2004
    Location
    Whistler, Br. Columbia, Canada
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, I found that tutorial but the code example doesn't seem to work properly. I chose the sample "Calculate a day, date, month and year, using n days delay" but it seems to be adding n months instead of n days...

  4. #4
    Lounger
    Join Date
    Jun 2004
    Location
    Whistler, Br. Columbia, Canada
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by JonTom View Post
    Yes, I found that tutorial but the code example doesn't seem to work properly. I chose the sample "Calculate a day, date, month and year, using n days delay" but it seems to be adding n months instead of n days...
    Figured it out. The code was correct, however, it assumed that the short date order used by Word/Windows was DD-MM-YY. Since I'm dealing with an American piece of software, it was giving MM-DD-YY, so the DELAY was added to the wrong part of the date. Changing the order of the "{DD} {MM} {YY}" code at the end of code sample to "{MM} {DD} {YY}" fixed it.

Posting Permissions

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