V
VJ
Hi,
I am working on a query and I was going to use UNION but I want to make sure
it only pulls all the criteria requested in my search. I am doing a Vendor
database and I want it to pull City, Restaurant not to just pull everything
that pops up for the city as an example. I have categories to search by as
well location. My code looks like this.
SELECT Master.[Name of Property], Master.[Address 1], Master.[Address 2],
Master.City, Master.State, Master.Zip, Master.[NY Area], Master.[Main Phone],
Master.Category1, Master.Category2, Master.[Contact Name], Master.Phone
FROM Master
WHERE ((Master.City)=[Forms]![Search 2]![City]))
UNION
SELECT Master.[Name of Property], Master.[Address 1], Master.[Address 2],
Master.City, Master.State, Master.Zip, Master.[NY Area], Master.[Main Phone],
Master.Category1, Master.Category2, Master.[Contact Name], Master.Phone
FROM Master
WHERE (((Master.City)=[Forms]![Search 2]![City]) AND
((Master.Category1)=[Forms]![Search 2]![Category1]))
Do I need to put it into a certain order so that I can get the search I am
looking for? Help please! Thanks in advance.
VJ
I am working on a query and I was going to use UNION but I want to make sure
it only pulls all the criteria requested in my search. I am doing a Vendor
database and I want it to pull City, Restaurant not to just pull everything
that pops up for the city as an example. I have categories to search by as
well location. My code looks like this.
SELECT Master.[Name of Property], Master.[Address 1], Master.[Address 2],
Master.City, Master.State, Master.Zip, Master.[NY Area], Master.[Main Phone],
Master.Category1, Master.Category2, Master.[Contact Name], Master.Phone
FROM Master
WHERE ((Master.City)=[Forms]![Search 2]![City]))
UNION
SELECT Master.[Name of Property], Master.[Address 1], Master.[Address 2],
Master.City, Master.State, Master.Zip, Master.[NY Area], Master.[Main Phone],
Master.Category1, Master.Category2, Master.[Contact Name], Master.Phone
FROM Master
WHERE (((Master.City)=[Forms]![Search 2]![City]) AND
((Master.Category1)=[Forms]![Search 2]![Category1]))
Do I need to put it into a certain order so that I can get the search I am
looking for? Help please! Thanks in advance.
VJ