Search code examples
sqlms-accessms-access-2016

Why does Access demand a parameter for my query?


AgencyID produces an output, but not the output I need. I need to create the query without having to enter a parameter value.

I've tried ()"" even put the Y separate from the 68 and even tried concatenation

SELECT AgencyID, Description, DonationID, DonationDate
FROM Donation
WHERE Description='Computer Equipment' OR AgencyID='Y68'
ORDER BY AgenyID, Description;

Output I'm receiving, but need to create the query automatically without parameter box

enter image description here


Solution

  • In the ORDER BY clause AgencyID is spelled wrong. That's why Access is prompting you.

    SELECT AgencyID, Description, DonationID, DonationDate
    FROM Donation
    WHERE Description='Computer Equipment' OR AgencyID='Y68'
    ORDER BY AgencyID, Description;
    

    enter image description here