Mod Function in Query

DBFIN

Registered User.
Local time
Yesterday, 19:44
Joined
May 10, 2007
Messages
205
I want to use the mod function in a query to evalate whether the "Year" field contains an even or odd year. Years 2016 ,2014, 2012 would be even and years 2015, 2013, 2011 would be odd. How can I use the mod function to do this ?
 
I want to use the mod function in a query to evalate whether the "Year" field contains an even or odd year. Years 2016 ,2014, 2012 would be even and years 2015, 2013, 2011 would be odd. How can I use the mod function to do this ?

Assuming you are referring to the current date you could write

iif(year(date()) mod 2=0,"even","odd")
 
Thanks everyone for your quick replies. Your comments provided the perfect solution to my issue.
 

Users who are viewing this thread

Back
Top Bottom