Re: Automating record selection parameters
- From: "DickChristoph" <dchristo101@xxxxxxxxx>
- Date: Mon, 27 Feb 2006 18:44:57 GMT
Hi Edgar,
How about:
Create proc rb_SubledgerRpt
@Acctcode varchar(4), @SubAcct varchar(3)
As
Select AcctCode, SubAcct
From GLDetailsWhere SubAcct <> ' '
and ((@AcctCode = '*' ) or (AcctCode = @Acctcode))
and ((@SubAcct = '*' ) or (SubAcct = @SubAcct))
-*** Christoph
"Edgar" <edgarjtan@xxxxxxxxx> wrote in message
news:1141058639.691125.36720@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I need some advise on how to automate record selection on a stored
proc. Here is my situation. I have a stored proc that I used on
Crystal reports with two parameters - Acctcode and Subacct. When a
user enters ' *' on these parameter, it means to report on all
accounts otherwise, report only on specific account.
Here is my select statement with line numbers:
Create proc rb_SubledgerRpt
@Acctcode varchar(4), @SubAcct varchar(3)
As
3 Select AcctCode, SubAcct
4 From GLDetails
5 Where SubAcct <> ' '
6 and AcctCode = @Acctcode -- for specific acctcode
7 and SubAcct = @SubAcct -- for specific subacct
8 Go
-- If a user wants to see all Acctcode, and all Subacct, how do I
disable lines 6 and 7?
Thank you in advance for your help.
Edgar
.
- References:
- Automating record selection parameters
- From: Edgar
- Automating record selection parameters
- Prev by Date: Re: tools for analysis relations
- Next by Date: sqlservr.exe memory usage
- Previous by thread: Automating record selection parameters
- Next by thread: Re: Automating record selection parameters
- Index(es):