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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query even numbers? 1

Status
Not open for further replies.

Pccoordinator

IS-IT--Management
Feb 22, 2000
101
US
Have an access (2000) database I want to query a field (ID) and have the query only pull out the even number records in the ID field.

Can this be done???
 
Yes, add a field to the QBE grid using the following syntax(substitute your actual field names where I have place holders):

Even: [FieldName] Mod 2

Then, in this field's criteria put False. The remainder of any even number when divided by 2 is 0. Since 0 is always False(another way to look at it, is any number that is NOT 0 is True) then setting the criteria to False will give you only those records that are even.
 
It's great. I have a list of 150,000 names and needed to sort every other name into a list. This worked great.
Thanks for the help Jerry!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top