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!

Count records in a report using criteria

Status
Not open for further replies.

littleboots

Technical User
Nov 5, 2002
13
GB
I need to be able to show total numbers of bookings of twin and single rooms in a report. The rooms have different codes in the field [PKGE], so providing a list of people is no problem (sort by PKGE to get twins first, then singles).
How do I count the number of twin rooms? If I do =count(*) in the PKGE Footer, I get the number of people e.g. 20, not the number of rooms e.g. 10.
The lead passenger can be identified using another field [PAXNUMBER], their passenger number always being 1.
can I create a count expression that will only count PAXNUMBER = 1?
 
May be you could leverage off the following query,

SELECT PKGE, Count(PKGE) AS CntPKGE FROM <<TABLE>>
GROUP BY PKGE;

If you only new the listing of those corresponding to &quot;twins&quot;, then add a WHERE clause just prior to the GROUP BY clause.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top