need help on access with sql

A

amitbadgi

Hello guys, I will explain u exactly what
I am looking for,
There are 4 different cities and each city has 2 access tables from
which I need to pull my data, I had written a query which selects teh
required data from one city, now each city has different business ID
and different data to pull out, like for example, when a user enters a
BID 16139, say it belongs to city A, hence it shld pull in the adress,
license num, phonenum from teh table(thats in city A), and then if he
enters say 17890, which belongs to city B, it shld pull out adress,
license num, phonenum from city B. Now my question is that, I have
written a query which works for one city with 2 tables, I want to know
how do I combine all teh cities so that when a user enters a BID he
would get the required data from the related table and not include
anyother data from any other city. here
is the query that i had written

SELECT dbo_businessNC.bus_name, dbo_businessNC.adrs1,
dbo_businessNC.adrs2,
dbo_businessNC.city, dbo_businessNC.state, dbo_businessNC.zip,
dbo_businessNC.phone, dbo_licenseNC.license
FROM dbo_businessNC, dbo_licenseNC
WHERE (((dbo_businessNC.bus_id)=[Forms].[Form1].[text2] And
(dbo_businessNC.bus_id)=[dbo_licenseNC].[bus_id]));

Now I want to add in these queries too,
SELECT [Hawthorne Acc summary].[Account Name]
FROM [Hawthorne Acc summary]
WHERE (([Hawthorne Acc summary].[ID]=[Form].[Form1].[Text2]));

SELECT [Martinez Business License Master]. [ID] FROM [Martinez
Business License Master] WHERE [Martinez Business License Master].[ID]
= [Form].[Form1].[Text2];

So I am not sure how to combine both these queries to get teh right
data to get selected.
 
A

aaron.kempf

store your stuff in less tables.

no reason for NC data to be in a different table than WA

good luck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top