I have the following query that I'd like to run in a report, click a selected statename and have it generate another detailed report with all assets that match that state.
SELECT
ts.Statename,
ts.State,
count(ta.AssetID) AS Total
FROM
tblAssets AS ta
INNER JOIN tblAssetCustom AS tac ON tac.AssetID = ta.AssetID
INNER JOIN tblState AS ts ON ts.State = tac.State
GROUP BY
ts.Statename,
ts.State
ORDER BY ts.Statename
_______________________________
Output:
Statename State Total
Active 1 3994
Harvested 15 2
Inventoried 12 38
Non-active 2 540
Salvaged 10 119
Suspended 14 2
For example, if you clicked "Harvested" you'd see the details of the two assets that match that state. Is this possible?