Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Making parameters independent of its execution... very urgent requirement Expand / Collapse
Author
Message
Posted Thursday, January 2, 2014 4:18 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, April 23, 2014 3:13 AM
Points: 26, Visits: 41
I have another requirement that the parameters should be independent of its execution.I have six parameters which should be independent of its execution.

I have done it using if else statements..

Six parameters are ticket no,order type,from date,to date,shpdateto,shpdate from.

I have stored the select statements inside variables to make sure which has to be executed in which case.

Used the same inside If --- else statements.

I have done like this...

if @fromdate is null and @todate is null and @ordertype <>''
begin
set @a = @x
end
else if @ticketno = '' and AND (@FromDate <> NULL AND @ToDate <> NULL) AND (@shpdatefrom = null and @shpdateto = null) and @OrderType <> ''
begin
set @a = @y
end
else if @ticketno = '' AND (@shpdatefrom IS NOT NULL and @shpdateto IS NOT NULL) AND @OrderType <> ''
begin
set @a = @z
end


My problem is if I give shpdatefrom and o values alone and leave the other columns blank im getting error saying one or more parameters need to be filled.

The same happens for from date and to date also.

Pls help me out...

Its very urgent requirement


Post #1527032
Posted Friday, August 15, 2014 10:33 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Today @ 9:19 AM
Points: 42, Visits: 301
You can set a parameter to allow nulls.

In the Report Data tab, right click on the Parameter name and choose Parameter Properties. The General screen has the option: Allow null value.
Post #1603781
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse