Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Jenny B.[_2_] Jenny B.[_2_] is offline
external usenet poster
 
Posts: 6
Default Date Calculation Question for Macropod

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

  #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


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Date Calculation Question for Macropod

Macropod has covered TIME delays at the end of document you can download
from http://www.gmayor.com/downloads.htm#Third_party
To add 12 hours to the Time associated with the SAVEDATE, substitute
SAVEDATE for the TIME field and change the delay to 12:00:00 thus:

{QUOTE
{SET Time1 {SAVEDATE \@ HH:mm:ss}}
{SET Time2 12:00:00}
{SET SumTime{=({Time1 \@ HH}+{Time2 \@ HH})*3600+({Time1 \@ mm}+{Time2 \@
mm})*60+{Time1 \@ ss}+{Time2 \@ ss}}}
{=INT(SumTime/86400) \# +0\ ;-0\ ;}
{=(MOD(ABS(INT(SumTime/3600)+11),12)+1)*10000+INT((SumTime-INT(SumTime/3600)*3600)/60)*100+MOD(SumTime,60)
\# 0:00:00}
{IF{=MOD(INT(SumTime/3600),24)} 12 \ a.m. \ p.m.}}

or (24 hour clock).


{QUOTE
{SET Time1 {SAVEDATE \@ HH:mm:ss}}
{SET Time2 12:00:00}
{SET SumTime{=({Time1 \@ HH}+{Time2 \@ HH})*3600+({Time1 \@ mm}+{Time2 \@
mm})*60+{Time1 \@ ss}+{Time2 \@ ss}}}
{=INT(SumTime/86400) \# +0\ ;-0\ ;}
{=(MOD(ABS(INT(SumTime/3600)+23),24)+1)*10000+INT((SumTime-INT(SumTime/3600)*3600)/60)*100+MOD(SumTime,60)
\# 00:00:00}}

Note that savedate fields do not update automatically when you save the
document. This can result in the form showing incorrect dates and then if
the fields are updated the form will require saving again to record the new
savedate, and thus the savedate saved with the document is the previous
savedate and not the current one. Are you sure that Savedate is the best
date type for your requirements? Frankly if you save the form as a template
and create form documents from it Createdate would probably make more sense.

No doubt Macropod will be along soon with his observations

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Jenny B. wrote:
Hi Macropod,

I've 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 don't seem to focus on doing
calculations for just Time Difference vs. calculating Date Periods.
I'm trying to add time to the SAVEDATE time value. I still need the
SAVEDATE value to appear on my form, but I'm hoping to add another
field using that same logic as a springboard. I'd 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



  #4   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 Graham,

"No doubt Macropod will be along soon with his observations". Hmm, 'soon' has interesting connotations in this context - my initial
reply preceded yours!

--
Cheers
macropod
[MVP - Microsoft Word]


"Graham Mayor" wrote in message ...
Macropod has covered TIME delays at the end of document you can download from http://www.gmayor.com/downloads.htm#Third_party
To add 12 hours to the Time associated with the SAVEDATE, substitute SAVEDATE for the TIME field and change the delay to 12:00:00
thus:

{QUOTE
{SET Time1 {SAVEDATE \@ HH:mm:ss}}
{SET Time2 12:00:00}
{SET SumTime{=({Time1 \@ HH}+{Time2 \@ HH})*3600+({Time1 \@ mm}+{Time2 \@ mm})*60+{Time1 \@ ss}+{Time2 \@ ss}}}
{=INT(SumTime/86400) \# +0\ ;-0\ ;}
{=(MOD(ABS(INT(SumTime/3600)+11),12)+1)*10000+INT((SumTime-INT(SumTime/3600)*3600)/60)*100+MOD(SumTime,60) \# 0:00:00}
{IF{=MOD(INT(SumTime/3600),24)} 12 \ a.m. \ p.m.}}

or (24 hour clock).


{QUOTE
{SET Time1 {SAVEDATE \@ HH:mm:ss}}
{SET Time2 12:00:00}
{SET SumTime{=({Time1 \@ HH}+{Time2 \@ HH})*3600+({Time1 \@ mm}+{Time2 \@ mm})*60+{Time1 \@ ss}+{Time2 \@ ss}}}
{=INT(SumTime/86400) \# +0\ ;-0\ ;}
{=(MOD(ABS(INT(SumTime/3600)+23),24)+1)*10000+INT((SumTime-INT(SumTime/3600)*3600)/60)*100+MOD(SumTime,60) \# 00:00:00}}

Note that savedate fields do not update automatically when you save the document. This can result in the form showing incorrect
dates and then if the fields are updated the form will require saving again to record the new savedate, and thus the savedate
saved with the document is the previous savedate and not the current one. Are you sure that Savedate is the best date type for
your requirements? Frankly if you save the form as a template and create form documents from it Createdate would probably make
more sense.

No doubt Macropod will be along soon with his observations

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Jenny B. wrote:
Hi Macropod,

I've 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 don't seem to focus on doing
calculations for just Time Difference vs. calculating Date Periods.
I'm trying to add time to the SAVEDATE time value. I still need the
SAVEDATE value to appear on my form, but I'm hoping to add another
field using that same logic as a springboard. I'd 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




  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Date Calculation Question for Macropod

At the time I prepared my message you hadn't posted .. so 'soon' then
applied
It's all to do with the speed the system is refreshed and it does sometimes
make individual replies seem a bit odd ... or annoyingly irrelevant

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Graham,

"No doubt Macropod will be along soon with his observations". Hmm,
'soon' has interesting connotations in this context - my initial
reply preceded yours!

"Graham Mayor" wrote in message
...
Macropod has covered TIME delays at the end of document you can
download from http://www.gmayor.com/downloads.htm#Third_party To add 12
hours to the Time associated with the SAVEDATE, substitute
SAVEDATE for the TIME field and change the delay to 12:00:00 thus:

{QUOTE
{SET Time1 {SAVEDATE \@ HH:mm:ss}}
{SET Time2 12:00:00}
{SET SumTime{=({Time1 \@ HH}+{Time2 \@ HH})*3600+({Time1 \@
mm}+{Time2 \@ mm})*60+{Time1 \@ ss}+{Time2 \@ ss}}}
{=INT(SumTime/86400) \# +0\ ;-0\ ;}
{=(MOD(ABS(INT(SumTime/3600)+11),12)+1)*10000+INT((SumTime-INT(SumTime/3600)*3600)/60)*100+MOD(SumTime,60)
\# 0:00:00} {IF{=MOD(INT(SumTime/3600),24)} 12 \ a.m. \ p.m.}} or (24
hour clock).


{QUOTE
{SET Time1 {SAVEDATE \@ HH:mm:ss}}
{SET Time2 12:00:00}
{SET SumTime{=({Time1 \@ HH}+{Time2 \@ HH})*3600+({Time1 \@
mm}+{Time2 \@ mm})*60+{Time1 \@ ss}+{Time2 \@ ss}}}
{=INT(SumTime/86400) \# +0\ ;-0\ ;}
{=(MOD(ABS(INT(SumTime/3600)+23),24)+1)*10000+INT((SumTime-INT(SumTime/3600)*3600)/60)*100+MOD(SumTime,60)
\# 00:00:00}} Note that savedate fields do not update automatically when
you save
the document. This can result in the form showing incorrect dates
and then if the fields are updated the form will require saving
again to record the new savedate, and thus the savedate saved with
the document is the previous savedate and not the current one. Are
you sure that Savedate is the best date type for your requirements?
Frankly if you save the form as a template and create form documents
from it Createdate would probably make more sense. No doubt Macropod
will be along soon with his observations

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Jenny B. wrote:
Hi Macropod,

I've 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 don't seem to focus on doing
calculations for just Time Difference vs. calculating Date Periods.
I'm trying to add time to the SAVEDATE time value. I still need the
SAVEDATE value to appear on my form, but I'm hoping to add another
field using that same logic as a springboard. I'd 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





  #6   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

Far be it from me to suggest anything you post is 'annoyingly irrelevant' (;

--
Cheers
macropod
[MVP - Microsoft Word]


"Graham Mayor" wrote in message ...
At the time I prepared my message you hadn't posted .. so 'soon' then
applied
It's all to do with the speed the system is refreshed and it does sometimes
make individual replies seem a bit odd ... or annoyingly irrelevant

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



macropod wrote:
Hi Graham,

"No doubt Macropod will be along soon with his observations". Hmm,
'soon' has interesting connotations in this context - my initial
reply preceded yours!

"Graham Mayor" wrote in message
...
Macropod has covered TIME delays at the end of document you can
download from http://www.gmayor.com/downloads.htm#Third_party To add 12
hours to the Time associated with the SAVEDATE, substitute
SAVEDATE for the TIME field and change the delay to 12:00:00 thus:

{QUOTE
{SET Time1 {SAVEDATE \@ HH:mm:ss}}
{SET Time2 12:00:00}
{SET SumTime{=({Time1 \@ HH}+{Time2 \@ HH})*3600+({Time1 \@
mm}+{Time2 \@ mm})*60+{Time1 \@ ss}+{Time2 \@ ss}}}
{=INT(SumTime/86400) \# +0\ ;-0\ ;}
{=(MOD(ABS(INT(SumTime/3600)+11),12)+1)*10000+INT((SumTime-INT(SumTime/3600)*3600)/60)*100+MOD(SumTime,60)
\# 0:00:00} {IF{=MOD(INT(SumTime/3600),24)} 12 \ a.m. \ p.m.}} or (24
hour clock).


{QUOTE
{SET Time1 {SAVEDATE \@ HH:mm:ss}}
{SET Time2 12:00:00}
{SET SumTime{=({Time1 \@ HH}+{Time2 \@ HH})*3600+({Time1 \@
mm}+{Time2 \@ mm})*60+{Time1 \@ ss}+{Time2 \@ ss}}}
{=INT(SumTime/86400) \# +0\ ;-0\ ;}
{=(MOD(ABS(INT(SumTime/3600)+23),24)+1)*10000+INT((SumTime-INT(SumTime/3600)*3600)/60)*100+MOD(SumTime,60)
\# 00:00:00}} Note that savedate fields do not update automatically when
you save
the document. This can result in the form showing incorrect dates
and then if the fields are updated the form will require saving
again to record the new savedate, and thus the savedate saved with
the document is the previous savedate and not the current one. Are
you sure that Savedate is the best date type for your requirements?
Frankly if you save the form as a template and create form documents
from it Createdate would probably make more sense. No doubt Macropod
will be along soon with his observations

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Jenny B. wrote:
Hi Macropod,

I've 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 don't seem to focus on doing
calculations for just Time Difference vs. calculating Date Periods.
I'm trying to add time to the SAVEDATE time value. I still need the
SAVEDATE value to appear on my form, but I'm hoping to add another
field using that same logic as a springboard. I'd 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



  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Jenny B.[_2_] Jenny B.[_2_] is offline
external usenet poster
 
Posts: 6
Default Date Calculation Question for Macropod

Thank you. This works just the way I was hoping and I really appreciate your
help.

Take care and thanks again €“ Jenny B.


"macropod" wrote:

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



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
@macropod [email protected] Microsoft Word Help 1 April 15th 08 01:46 PM
Calculation using date mergefield Word 2003 Morag Microsoft Word Help 1 August 7th 07 01:46 PM
Date Calculation alyles Tables 1 November 20th 06 09:04 PM
Date calculation - for a NON-genius Gilbert De Ceulaer Mailmerge 3 November 2nd 06 11:45 AM
date field calculation cal Microsoft Word Help 1 November 17th 05 08:54 PM


All times are GMT +1. The time now is 11:16 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright İ2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"