T
Tosca
Hi everyone
I have an Excel sheet which contains a series of dates. I have set their
format to "d MMMM yyyy". One of them is taken into Word 2003 as a field
named LastPayment. I want to compare this with a specific date (24
September 2005) and, depending upon whether the result indicated the past or
future, either "was" or "is" should be returned.
I have tried the following, but it doesn't work correctly:
{ IF { MERGEFIELD LastPayment \@ "d MMMM yyyy" } > "24 September 2005" "is"
"was" }
It works OK if the day is after 24 (i.e. "28 February 2005" returns "is",
whilst "20 December 2005" returns "was") but it doesn't examine the whole
date for the comparison.
I tried forcing 24 September 2005 to this format by adding a switch:
{ IF { MERGEFIELD LastPayment \@ "d MMMM yyyy" } > "24 September 2005 \@ d
MMMM yyyy" "is" "was" }
but this didn't make any difference, nor did it result in an error. I don't
even know if the application of a switch in this way is logical or
appropriate.
How do I change this to make the comparison work correctly?
Thanks for your time.
Tosca
I have an Excel sheet which contains a series of dates. I have set their
format to "d MMMM yyyy". One of them is taken into Word 2003 as a field
named LastPayment. I want to compare this with a specific date (24
September 2005) and, depending upon whether the result indicated the past or
future, either "was" or "is" should be returned.
I have tried the following, but it doesn't work correctly:
{ IF { MERGEFIELD LastPayment \@ "d MMMM yyyy" } > "24 September 2005" "is"
"was" }
It works OK if the day is after 24 (i.e. "28 February 2005" returns "is",
whilst "20 December 2005" returns "was") but it doesn't examine the whole
date for the comparison.
I tried forcing 24 September 2005 to this format by adding a switch:
{ IF { MERGEFIELD LastPayment \@ "d MMMM yyyy" } > "24 September 2005 \@ d
MMMM yyyy" "is" "was" }
but this didn't make any difference, nor did it result in an error. I don't
even know if the application of a switch in this way is logical or
appropriate.
How do I change this to make the comparison work correctly?
Thanks for your time.
Tosca