Comparing dates in IF statement

G

Guest

Is it possible to compare two dates (as to whether one is before the other)
in an IF statement? I want to insert certain text if the date of the letter
(DATE) is earlier than a date I have bookmarked, and different text if it is
later. I tried { IF TODAY>StartDate "abc" "def" }, but it does not perform
an accurate comparison.
 
G

Guest

Thanks, Graham. I later found a reference to a Word date & time manipulation
article which had the simple and direct answer of formatting into yyyyMMdd
format for the compare.
 
G

Graham Mayor

I could have simply written the switch, but the article on my web site
explains why it works, which surely is of more benefit?

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

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>.
 
S

Suzanne S. Barnhill

Not everyone wants to learn how to fish, unfortunately.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top