I have the following Query:
SELECT *
FROM tbl_Muffins
WHERE OvenLoadId IN (
SELECT OvenLoadId
FROM tbl_Muffins
WHERE OrderId = ?
GROUP BY OvenLoadId
)
ORDER BY OvenLoadId, LocationNumber ASC
The idea of the query is that I want to specify an OrderId, and I want all Oven Loads that have items from that order in them, as well as ALL OTHER ITEMS in those loads, even though they could be from other orders.
The query works as expected, but I’m not able to use it for my Crystal Report I’ve written it for.
I have put this query into a User Defined Function, however I’m unable to use a call to that function as a table source in my Crystal Report. I am using Visual Studio 2003 (I know it is old, the client refuses to upgrade).
What am I doing wrong?
Thanks,
jnsohnumr
From version 9 of Crystal Reports onwards, it became possible to report from custom queries using Crystal’s “Add Command” functionality.
There is a description of adding a parameter to a command query here.