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

Query month + Yes/No 1

Status
Not open for further replies.

McFestoe

Technical User
Dec 16, 2003
145
GB
I have the following query set up which lists jobs that are to be done in a set month, the month is selected from a combo box [text8] this is fine but it list every customer that is due in a month, so i put a yes/no box in table1 so service contract = yes or no (tick style).

What i have been trying to do is run the query so it lists the customers that are due in the month selected by the combo box and only list customers where the yes/no field = yes.

this is how my query is set up at the moment.

SELECT Table1.[Service Month 1], Table1.[Service Month 2], Table1.[Service Month 3], Table1.[Service Month 4], *
FROM Table1
WHERE (((Table1.[Service Month 1])=[Forms]![ReportForm]![text8])) OR (((Table1.[Service Month 2])=[Forms]![ReportForm]![text8])) OR (((Table1.[Service Month 3])=[Forms]![ReportForm]![text8])) OR (((Table1.[Service Month 4])=[Forms]![ReportForm]![text8]));


 
SELECT *
FROM Table1
WHERE ([Service Month 1]=[Forms]![ReportForm]![text8] OR
[Service Month 2]=[Forms]![ReportForm]![text8] OR
[Service Month 3]=[Forms]![ReportForm]![text8] OR
[Service Month 4])=[Forms]![ReportForm]![text8])
AND [ServiceContract]=-1;

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Duane

Thanks again, i have been trying for ages with my head buried in books and still could not work it how.

Just one question.

SELECT* does this mean all fields
 
SELECT * does this mean all fields
Yes.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top