Why does this query ask for a parameter?

Mike1138

Board Regular
Joined
Jun 8, 2013
Messages
54
I posted a question yesterday about a problem I was having bringing the results of a query into Excel from Access. No solutions were found.

After doing some testing, I believe the problem may be with this subquery:

Code:
SELECT Max(O.ChngDate) 
FROM tblOSHAHistory AS O 
WHERE O.ClaimNum = tblOSHAHistory.ClaimNum

It asks me to enter a parameter for tblOSHAHistory.ClaimNum, despite the fact that I haven't assigned any parameters.

I'm an SQL novice, but I don't think I've missed anything here. My SQL produces the desired results in Access and returns a null set in Excel.
 

Some videos you may like

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

ukmikeb

Well-known Member
Joined
Jul 10, 2009
Messages
2,757
Hi

Perhaps you are confusing it because you have assigned the table name tblOSHAHistory to O.

I suggest that you run a straight query like :-
Code:
"SELECT O.ClaimNum, O.OSHAStat, Max(O.ChngDate) " _
& "FROM tblOSHAHistory AS O " _
& "WHERE O.OSHAStat Like " & Chr(34) & "R*" & Chr(34) & " " _
& "ORDER BY O.ClaimNum "

hth
 

Watch MrExcel Video

Forum statistics

Threads
1,122,576
Messages
5,596,973
Members
414,115
Latest member
SFUser

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top