FROM `JC_Data`.`Page_Count Query` `Page_Count Query`
WHERE (`Page_Count Query`.`Customer Code`=?) AND (`Page_Count Query`.PGCT=?)
What I'm hoping to return is not only the 'Customer Code' and 'PGCT' that match the parameters set in the sheet, but also the three most recent transactions by 'Close Date'. The few statements I've tried, I've had no luck w/. Anyone have suggestions?
Without testing it, I would guess the ORDER BY clause is the problem. Depending on the ANSI compatibility standard that your system uses, you may need to DISPLAY/SELECT the field used in the ORDER BY,
So you might try
ORDER BY 'Close Date'
Some variation of the actual names used (Literal or aliased)
You might also try this
SELECT TOP 3
FROM [JC_Data].[Page_Count Query] P
WHERE (P.[Customer Code]=?) AND (P.PGCT=?)
ORDER BY P.[Close Date]
Yeah I'm still getting the same error. I've tried removing some fields to isolate the problem and it seems to come back to the Close Date. I'm pursuing another avenue through some Excel formulas but if anyone has another suggestion for the Query, that is my preferred means.