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!

Simple Query Help 1

Status
Not open for further replies.

ptrifile

Technical User
Joined
Aug 10, 2004
Messages
457
Location
US
I am using the following query to pull records that have a specific call status, records that are not "completed" and records that have the field "EditDate" that is either NULL or less than todays date. Problem i am having is that when running this query it is pulling records with all the "call status's" not just the VM2's like i intended it to. Please help if you can.

Code:
SELECT TblMain.ID, TblMain.[Order Number], TblMain.[Reschedule Reason], TblMain.[Last Schedule Date], TblMain.Store, TblMain.[Call Status], TblMain.[Work Order Updated], TblMain.Completed, TblMain.EditDate, TblMain.UserName, TblMain.EditTime
FROM TblMain
WHERE (((TblMain.[Call Status])="vm2") AND ((TblMain.Completed)=0) AND ((TblMain.EditDate) Is Null)) OR (((TblMain.EditDate)<Date()))
ORDER BY TblMain.[Work Order Updated];
 
Do you want:

WHERE TblMain.[Call Status]="vm2" AND (TblMain.Completed=0 AND (TblMain.EditDate Is Null OR TblMain.EditDate<Date))
 
Remou, that worked PERFECTLY! Thank you so much for the help!!!!!!

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top