Count even numbered records (1 Viewer)

Ron_dK

Cool bop aficionado
Local time
Today, 11:14
Joined
Sep 5, 2002
Messages
2,141
I have a table with quite a number of records.
In this table I have a field [Qnumber], which gives me a sequential number.
The field size is Long Integer. So my records are numbered 1, 2, 3, ....n
What I want to achieve is to select only the even numbered records in this table, i.e. Qnumber = 2, 4, 6, ...... etc.
I can't find a way to do this.
Would appreciate any help on this.
 

stopher

AWF VIP
Local time
Today, 10:14
Joined
Feb 1, 2006
Messages
2,395
your WHERE statement needs to look like this:

WHERE [Qnumber] Mod 2=0


If you want the odd numbers then:

WHERE [Qnumber] Mod 2=1


hth
Chris
 

MStef

Registered User.
Local time
Today, 10:14
Joined
Oct 28, 2004
Messages
2,251
Look at "DemoModA2000.mdb"
look at Table1, Query1 (column 4).
 

Attachments

  • DemoModA2000.zip
    7.3 KB · Views: 78

Ron_dK

Cool bop aficionado
Local time
Today, 11:14
Joined
Sep 5, 2002
Messages
2,141
The SQL :

SELECT Table1.QNumber,
FROM Table1
WHERE ((([Qnumber] Mod 2)=0));

works fine.

Thanks guys.
 

Users who are viewing this thread

Top Bottom