G
Guest
I want to adapt a Stored Procedure like the following for reporting purposes.
select
frmInstId,
frmName,
frmDueDate,
country,
description,
frmLastStatus
flgStat1,
flgStat2,
flgStat3,
flgStat4,
flgStat5
FROM
tblFrmDef,
tblFrmInst,
tblFrmHist,
tblObjects
WHERE
tblFrmDef.frmDefId = tblFrmInst.frmDefId and
tblFrmInst.objId = tblObjects.objId and
tblFrmInst.frmInstId = tblFrmHist.frmInstId and
tblFrmInst.flgActive=1
The problem is that the report can potentially take numerous permutations of
numerous parameters, including:
-tblFrmInst.frmDueDate (range possible)
-tblObjects.user
-tblFrmInst.flgActive (1 or 0)
-tblDef.frmName,
-tblFrmHist.frmLastStatus,
-flgStat1,
-flgStat2,
-flgStat3,
-flgStat4
-flgStat5
Short of building a heavily nested if...then...else statement to build the
correct select statement, are there any better ideas?
select
frmInstId,
frmName,
frmDueDate,
country,
description,
frmLastStatus
flgStat1,
flgStat2,
flgStat3,
flgStat4,
flgStat5
FROM
tblFrmDef,
tblFrmInst,
tblFrmHist,
tblObjects
WHERE
tblFrmDef.frmDefId = tblFrmInst.frmDefId and
tblFrmInst.objId = tblObjects.objId and
tblFrmInst.frmInstId = tblFrmHist.frmInstId and
tblFrmInst.flgActive=1
The problem is that the report can potentially take numerous permutations of
numerous parameters, including:
-tblFrmInst.frmDueDate (range possible)
-tblObjects.user
-tblFrmInst.flgActive (1 or 0)
-tblDef.frmName,
-tblFrmHist.frmLastStatus,
-flgStat1,
-flgStat2,
-flgStat3,
-flgStat4
-flgStat5
Short of building a heavily nested if...then...else statement to build the
correct select statement, are there any better ideas?