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

query question

Status
Not open for further replies.
Jun 4, 2003
18
GB
There are loads of companies, and in turn, each company may own many domains. How do i create a query that will produce the domains of a single company, rather than all the companies and all of their domains? there is hundereds of companies, so obviously i dont want to write a query for each company.

any ideas?
 
In your query, put the name of the company that you want to show in the where clause of the SQL (the criteria line in the query builder grid is the equivalent).

You will then only get domains associated with that company.
You could also change it to something like: [Enter company]
and you would be prompted to enter the company details as the query ran, to bypass the requirement to create one query per company.

John
 
One approach would to be to enter the name of the company when the query is ran, you can do this by using a variable name. For example

select company, domain1, domain2, domain3
from yourtable
where company like [varcompany]

This will prompt you to enter a company name for varcompany. Using like allows you to put in wildcards if you don't know the name exactly.

Dodge20
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top