In article <1177519657.544356.42570 (AT) c18g2000prb (DOT) googlegroups.com>,
actionman007 <actionman007 (AT) gmail (DOT) com> wrote:
Quote:
How can I check if a specific date or month exists in a field, if it
does then put a "X" in a corresponding field?
Cheers. |
For consistency sake I've used the American MM/DD/YY order. If you're
using a system with the English DD/MM/YY order you can simply swap all
the Month and Day numbers ... EXCEPT in the case of the Date function
below.
No doubt what you've already tried to do is use something like:
If (DateField = "4/1/2007", "X", "")
But this compares the DateField to a the TEXT value of "4/1/2007",
which makes no sense - even if the DateFiel does contain the date
4/1/2007 it doesn't match the text value of "4/1/2007".
Instead you have to convert your text value into a proper date value.
eg.
If(DateField = Date("4", "1", "2007"), "X", "")
Note: The Date function only accepts it's parameters in American MM,
DD, YY order.

\
or
If (DateField = TextToDate("4/1/2007"), "X", "")
If you want just the Month, then you can use the Month function,
eg.
If (Month(DateField) = "4", "X", "")
or the MonthName function.
eg.
If (MonthName(DateField) = "April", "X", "")
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)