Query Filter

  • Thread starter Thread starter Dee
  • Start date Start date
D

Dee

I have a salesman who mostly reports information outside of the US, but
occasionly, he will put in a report for a company in the US. He also needs
to see reports from salesman in his area. I cannot filter the Query by
"Prepared By" Preston because he needs to see reports submitted from
salesman in his area as well (which are not submitted by him). I cannot
filter by Not USA, because on occasion he will submit a report from a
company in the US. Here's the query... any suggestions on how to filter to
get all of this data in the same query?

SELECT [Trip Report Comments].Date, [Trip Report Comments].CNTID, [Trip
Report Comments].TCRID, [Trip Report Comments].ADID, Channel.Channel, [Trip
Report Comments].CHID, CHCompany.CHCompany, CHAddress.Division,
CHCompany.Type, CHAddress.Address, CHAddress.Address2, CHAddress.City,
CHAddress.State, CHAddress.Zip, Country.Country, [Trip Report
Comments].[Follow-up], [Trip Report Comments].Memo, [Trip Report
Comments].EquipmentCondition, [Trip Report Comments].AdditionalComments,
[Trip Report Comments].Action, [Trip Report Comments].Entered, [Trip Report
Comments].[Project Name], [Trip Report Comments].StatusID, [Trip Report
Comments].[Prepared By], [Trip Report Comments].File, [Trip Report
Comments].DoNotShow, [FirstName] & " " & [LastName] AS Contact, [Project
Status].Status
FROM CHCompany INNER JOIN ((Country INNER JOIN CHAddress ON Country.CntryID
= CHAddress.CntryID) INNER JOIN ([Project Status] INNER JOIN (Channel INNER
JOIN (CHContacts INNER JOIN [Trip Report Comments] ON CHContacts.CNTID =
[Trip Report Comments].CNTID) ON Channel.CHID = [Trip Report Comments].CHID)
ON [Project Status].StatusID = [Trip Report Comments].StatusID) ON
CHAddress.ADID = [Trip Report Comments].ADID) ON CHCompany.CHAID =
CHAddress.CHAID
WHERE ((([Trip Report Comments].EquipmentCondition) Is Null))
ORDER BY [Trip Report Comments].Date
WITH OWNERACCESS OPTION;
 
Hard to say exactly since I'm not sure which fields contain which data.

Try adding to the where clause

WHERE ((([Trip Report Comments].EquipmentCondition) Is Null)) AND
([Prepared by] = "Preston" OR SomeAreaField = "Preston's Area")
 
Back
Top