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

ACCESS Asking for paremeter value when running query.

Status
Not open for further replies.

signature

Programmer
Jul 25, 2001
8
US
In trying to run the following code; Access is asking me for parameter values.

I'd like to run a query on Market and exclude any Hospitals that were included in Mailing8_21.

I'm having complications running sql statements as my handbook presents. Could anyone refer me to a publication that as sql expressions Access can read?

SELECT [Hospital], [Title], [FName], [LName], [Street], [City], [State], [Zip]
FROM Market
WHERE (State IN ('NY'))
and Hospital NOT IN (Mailing8_21.Hospital);

Thank you
 
Hard to say, without the table structures and the parameter requests you're getting. Could you post at least those, and maybe the lists of field names in each table?
 
Hi!

I think you need to make (Mailing_28.Hospital) as subquery. Try (Select Mailing_28.Hospital From Mailing_28)

hth
Jeff Bridgham
 
Yes! The subquery worked. (See code below)

Thank you!


SELECT [Hospital], [Title], [FName], [LName], [Street], [City], [State], [Zip]
FROM Market
WHERE (State IN ('NY')) AND Hospital NOT IN (select Mailing8_21.Hospital From Mailing8_21) AND Hospital NOT IN ('Nyack Hospital')
ORDER BY [Hospital];
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top