Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to pull odd or even years from a datetime field

Status
Not open for further replies.

Juliep

Technical User
Aug 1, 2001
4
US
I need to create a report that pulls either all odd years and one for all even years from a datetime field (ie 3/1/1999 12:30pm). I also need it to exclude the current year. Does anyone have any suggestions.
Thanks
Julie
 
This should do it:

// Even Years
Year({DateFieldToCheck}) < Year(CurrentDateTime) and ((Year({DateFieldToCheck}) mod 2) = 0)

// Odd Years
Year({DateFieldToCheck}) < Year(CurrentDateTime) and ((Year({DateFieldToCheck}) mod 2) = 1)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top