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!

Unwanted "Enter Parameter" box in SQL Query Text

Status
Not open for further replies.

Aimee88

MIS
Jun 5, 2002
20
0
0
GB
Since reading a previous thread that matched my project ("Basic Query Question", MooseMan, thread 701-281213) and posting a question, I learned a litte more on my own. I now understand how to use SQL View in a select query.

I tried the following, to return the members that have donated for FY01, but not FY02. When I run the query it asks for a parameter value for [Fiscal_Year]. Any idea why?

Tables: Master and Donations


SELECT Master.TITLE, Master.FIRSTNAME, Master.LASTNAME, Master.MemberID
FROM Master
Inner Join Donations
On Master.MemberID=Donations.MemberID
Where (Donations.Fiscal_Year="FY01")
And Not Exists
(Select * From Donations
Where Donations.MemberID=Master.MemberID
And (Donations.Fiscal_Year="FY02"))


Can someone explain the funcion of the "*", also?

Thanks!

Aimee
 
The "*" returns all the fields for each record.

The reason it is prompting you for Fiscal_Year is usually due to Access not finding it in the table you are pulling from. Are you sure you spelled it correctly? Terry
**************************
* General Disclaimor - Please read *
**************************
Please make sure your post is in the CORRECT forum, has a descriptive title, gives as much detail to the problem as possible, and has examples of expected results. This will enable me and others to help you faster...
 
Also, I have seen Access just decide it wants []s around field names. If you spelled it correctly, try the []s.
 
The spellings are correct. The table is "Donations". But the field is actually "Fiscal Year" in the table. I added the underscore (Fiscal_Year) in the SQL. That was just a guess on my part. Is this relevant? Should I not use spaces in my field names?

Aimee
 
Using spaces in table or field names or for that matter anywhere is in my opinion not a good idea. To resolve the problem use [ ] around the name or change the names so as to remove the spaces.

Good Luck
ssecca
 
Thank you. With the space (no underscore) and [ ] it worked!

Aimee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top