Passing parameters among queries posible?

O

Offace

Hi NewGroup,

Is it possible to pass alike parameters among queries? Please consider the
following.

[qselDistinctValues]
PARAMETER [filterID] LONG;
SELECT DISTINCT [D].[Value]
FROM [tblFilterData] AS D
WHERE ([D].[FilterValue] = [filterID]);

[qselDistinctValueCount]
SELECT COUNT([D].[Value]) AS [Count]
FROM [qselDistinctValues] AS D;

'qselDistinctValueCount' for obvious reasons prompts for the 'filterID'
parameter defined in 'qselDistinctValues'. Is it possible in any way to
give 'qselDistinctValueCount' the mentioned parameter to pass it on to
'qselDistinctValues' so Access does not prompt twice for the 'same'
parameter? As it does this way.

[qselDistinctValueCount]
PARAMETER [filterID] LONG;
SELECT COUNT([D].[Value]) AS [Count]
FROM [qselDistinctValues] AS D;

Is there a way to construct the SQL to do this?

Many thanks and regards,
Offace.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top