View Single Post
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Date Calculation Question for Macropod

Hi Jenny,

This is quite simple. If, for example you were to use the first field under the heading 'Automatically Calculate A Past Or Future
Time of Day', you could modify the Time1 and Time1 parameters code from:
{SET Time1 {TIME \@ HH:mm:ss}}
{SET Time2 12:34:56}

to
{SET Time1 {SAVEDATE \@ HH:mm:ss}}
{SET Time2 12:00:00}

Note that the 'ss' part of the SAVEDATE always returns '00', so you can't really get a meaningful 'ss' calculation. If you therefore
want to force the calculation to round up to the next whole minute, you could change:
{SET Time2 12:00:00}
to
{SET Time2 12:01:00}
Be aware, though, that this will add 1 minute to the result even where the actual SAVEDATE time occurred on an exact minute
boundary.

--
Cheers
macropod
[MVP - Microsoft Word]


"Jenny B." wrote in message ...
Hi Macropod,

Ive read through your past postings on how to calculate between dates for
different periods of time (great work by the way). However, most of the
examples dont seem to focus on doing calculations for just Time Difference
vs. calculating Date Periods. Im trying to add time to the SAVEDATE time
value. I still need the SAVEDATE value to appear on my form, but Im hoping
to add another field using that same logic as a springboard. Id like to add
12 hours to the SAVEDATE time after the user saves the doc, but show just the
hour, minute, seconds and am/pm after calculation.

Do you have any other postings or documentation that provides examples doing
this vs. calculating the date periods?

Thank you for your review and thoughts €“ Jenny B.


EXAMPLE -- {=SAVEDATE \@ €œM/d/yyy h:mmm:ss am/pm€} + 12 hours - - GOAL €“
to have result appear as just H:MMM:SS AM/PM 12 hours later