Comparing Dates
I am trying to merge data from my Access database to a Word document. I am
trying to show in my Word document either the amount in the field for NovRent
or MayRent depending on the dates entered in NovRentDate and MayRentDate.
Code:
{If {MERGEFIELD NovRentDate}{MERGEFIELD MayRentDate} {MERGEFIELD NovRent}
{MERGEFIELD MayRent}}
My current scenario:
If 5/02/2005 (NovRentDate) 2/07/2005 (MayRentDate) then display $217.40
(NovRent) otherwise display $123.80 (MayRent)
My document displays $217.40 whereas it should display $123.80 as
MayRentDate is after NovRentDate. I am using Australian Date Format
(dd/mm/yyyy).
How can I get Word to compare the year, month and day as I think it is
currently only comparing the start of each date and therefore 5/02/2005 is
greater than 2/07/2005.
Any support will be greatly appreciated.
Regards
Gary
|