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

Query to select only those with completed criteria

Status
Not open for further replies.

rocket2000

Technical User
Jan 31, 2011
9
IE
Hi,

Hope I could get some assistance here?

I have a form and subform (datasheet) based on 2 tables, Customers and Customer Schedule.
Customer Schedule subform (datasheet) has a tick box named "Completed".

How do I select only those records for customers from this datasheet whose schedule have all been completed? I need to select ONLY those customers where ALL subsequent schedule lines in the datasheet have been marked completed. At the moment my query is selecting ALL customers with completed lines regardless if the last line is still not ticked completed(I do not want this). I only need to query those customers where ALL the datasheet lines have been marked completed from the first record to the last record of the datasheet

How can I separate customers with datasheet records ALL completed from those whose datasheet records may still have one record line not completed (usually the last line).

Any assistance would be greatly appreciated
 
How about providing table and field names as well as the relationships?

Generically
Code:
SELECT [Your various fields]
FROM Customers INNER JOIN CustomerSchedule on cusCusID = cscCusID
WHERE cscCusID IN (SELECT cscCusID FROM CustomerSchedule WHERE Completed = 0);

Duane
Hook'D on Access
MS Access MVP
 

In the database you posted, check this query:
qryScheduleComplete

Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top