Sorting by odd or even date

M

Mark G

I am looking for a way to write in code If an entered year is odd then
[another field]= 1 and if the entered year is even then [another field] = 0

The [another field] is used as part of a query that gathers either all the
odd or even numbered records for a report.

Thanks
Mark
 
A

Allen Browne

Use Mod 2 to determine odd/even.

In query design, you could type something like this into the Field row:

IsOdd: (Year([MyDate]) Mod 2) = 1))
 
Top