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

Querying

Status
Not open for further replies.

pleg12345

IS-IT--Management
Dec 21, 2003
48
EU
I want to count the amount of records that have been delivered and not delivered in the same query.

I have tried putting:
no of queries delivered : isCleared
Total: Count
then in the criteria defining whether its true or false

But it doesnt seem to recogise the fact whether is been delievered or not?

can somebody help?
 
There must be a column in your source table that identifies whether or not the record has been delivered. Let's assume it's a date column.

I'll do this in two steps for clarity.

First, build a query on the table that includes a newly defined column (where Delivery is the column with the delivery date):

IsDelivered: IIf(IsNull(Delivery],"No","Yes")

This is based on the idea that Delivery will be null unless there is a delivery.

The build a grouping query that has the following:

SELECT [IsDelivered], Count([IsDelivered]) FROM MyQuery Group by IsDelivered

This should give you the results you are looking for.

And you can probably just make them one grouping query instead of the two I showed for clarity.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top