IIF in where clause to exclude selection criteri when null
From: baz (anonymous_at_discussions.microsoft.com)
Date: 06/23/04
- Previous message: Hugo Kornelis: "Re: Dealing with Nulls, - use previous record"
- Next in thread: Vishal Parkar: "Re: IIF in where clause to exclude selection criteri when null"
- Reply: Vishal Parkar: "Re: IIF in where clause to exclude selection criteri when null"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 22 Jun 2004 17:47:31 -0700
Hi all,
I've got a huge Reprot in Crystal 8.5.
I've discovered that I can't work with the report if I
change the Stored Proc the report is based on. (this is
a kown and popular issue )
SO what I want to do in save the report under a different
name as attempt a more latteral approach by changing the
Stored Proc instead.
The original report criteria limits on AcctNum
What I want to do is be able to exlude AcctNum from the
selection criteria if its "ALL"
Original stored proc:
Select * from a
WHERE
AcctNum = @AcctNum
AND
a.FISCYR + a.FISCPER <= @year + @period
--------
What I want to do is something like this:
Select * from a
WHERE
iif( @AcctNum = "ALL", , "AcctNum = " + @AcctNum + "
AND " )
a.FISCYR + a.FISCPER <= @year + @period
Any suggestions?
Thanks,
baz
- Previous message: Hugo Kornelis: "Re: Dealing with Nulls, - use previous record"
- Next in thread: Vishal Parkar: "Re: IIF in where clause to exclude selection criteri when null"
- Reply: Vishal Parkar: "Re: IIF in where clause to exclude selection criteri when null"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|