Sorting by odd or even date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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))
 

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

Back
Top