Is there some esoteric programming practice within Word 2007 that allows the
comparison of dates? I.E., {Date1} <= {Date2} {Date1} is merged field and
{Date2} is today's date {DATE}. So far, I have found nothing that works. I
am attempting to create a Mergeformat renewal document when today's date has
passed a merge field date.

Re: How do I compare dates in Word 2007? by Greg

Greg
Tue Sep 11 22:19:21 CDT 2007

Sub Test()
Dim Date1 As Date 'The mergefield Date
Dim Date2 As Date 'Today
Date1 = "August 2 2007" 'Simulated result of mergefield
Date2 = Now
If DateDiff("d", Date2, Date1) < 0 Then
MsgBox "Your number is up"
End If
End Sub

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


BobTrudo wrote:
> Is there some esoteric programming practice within Word 2007 that
> allows the comparison of dates? I.E., {Date1} <= {Date2} {Date1} is
> merged field and {Date2} is today's date {DATE}. So far, I have
> found nothing that works. I am attempting to create a Mergeformat
> renewal document when today's date has passed a merge field date.



Re: How do I compare dates in Word 2007? by Graham

Graham
Wed Sep 12 00:59:40 CDT 2007

You can compare dates in fields also,

{IF {Mergefield Date1 \@ "yyyyMMdd"} <= {Date \@ "yyyyMMdd"} "Do this"
"otherwise do this"}

See http://www.gmayor.com/formatting_word_fields.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

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

BobTrudo wrote:
> Is there some esoteric programming practice within Word 2007 that
> allows the comparison of dates? I.E., {Date1} <= {Date2} {Date1} is
> merged field and {Date2} is today's date {DATE}. So far, I have
> found nothing that works. I am attempting to create a Mergeformat
> renewal document when today's date has passed a merge field date.



Re: How do I compare dates in Word 2007? by BobTrudo

BobTrudo
Wed Sep 12 05:52:13 CDT 2007

Many thanks for the reply. Sometimes, the really obvious eludes me.


"Greg Maxey" wrote:

> Sub Test()
> Dim Date1 As Date 'The mergefield Date
> Dim Date2 As Date 'Today
> Date1 = "August 2 2007" 'Simulated result of mergefield
> Date2 = Now
> If DateDiff("d", Date2, Date1) < 0 Then
> MsgBox "Your number is up"
> End If
> End Sub
>
> --
> Greg Maxey/Word MVP
> See:
> http://gregmaxey.mvps.org/word_tips.htm
> For some helpful tips using Word.
>
>
> BobTrudo wrote:
> > Is there some esoteric programming practice within Word 2007 that
> > allows the comparison of dates? I.E., {Date1} <= {Date2} {Date1} is
> > merged field and {Date2} is today's date {DATE}. So far, I have
> > found nothing that works. I am attempting to create a Mergeformat
> > renewal document when today's date has passed a merge field date.
>
>
>

Re: How do I compare dates in Word 2007? by BobTrudo

BobTrudo
Wed Sep 12 05:56:02 CDT 2007

Thanks Graham. Had I initially done a more thorough search of the forum,
your previous postings would have answered my questions. Thanks again.

"Graham Mayor" wrote:

> You can compare dates in fields also,
>
> {IF {Mergefield Date1 \@ "yyyyMMdd"} <= {Date \@ "yyyyMMdd"} "Do this"
> "otherwise do this"}
>
> See http://www.gmayor.com/formatting_word_fields.htm
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
> BobTrudo wrote:
> > Is there some esoteric programming practice within Word 2007 that
> > allows the comparison of dates? I.E., {Date1} <= {Date2} {Date1} is
> > merged field and {Date2} is today's date {DATE}. So far, I have
> > found nothing that works. I am attempting to create a Mergeformat
> > renewal document when today's date has passed a merge field date.
>
>
>