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

Errior in Jet SQL for Select Query 1

Status
Not open for further replies.

cbpwc01

Technical User
Feb 11, 2005
25
UM
I have been working on a select query in Microsoft Access 2002, and am very close to having it do what is needed. There is one error that I am unable to resolve.

In essence, I need to find all records for the most recent date. Instead of automatically finding these records, when I run the query a box pops up asking me to enter the parameter value. I would like to avoid this box since the end user will not necessarily know the date.

Where is the error in my code?

Code:
SELECT Record
FROM AllocationProformaFunds
WHERE EffectiveDate IN
(SELECT MAX(EffectiveDate) FROM AllocationProformaFunds)
 
You may try this:
SELECT *
FROM AllocationProformaFunds
WHERE EffectiveDate IN
(SELECT MAX(EffectiveDate) FROM AllocationProformaFunds)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks for the code, PHV. I tried it and for some reason I am getting the same box as before, and it is showing all dates, even when I enter a specific date. I'll keep messing with this and see how I can resolve it.
 
Are you sure that EffectiveDate is a field of the table AllocationProformaFunds ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
That was the problem! I had a space in the original name and eliminted that space.

Thanks again!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top