Monday, March 12, 2012

Nested Cases - is it possible?

I have the following code :
select {?TroubleType}
case "All Types":
{tbl_tickets.CustomerAcctNumber} <> '0' and
{tbl_tickets.OpenDate} >= {?BeginDate} and
{tbl_tickets.OpenDate} <= {?EndDate} and
{tbl_tickets.CustomerAcctNumber} <> '184114' and
{tbl_tickets.TroubleType} <> ""
case {?TroubleType}:
{tbl_tickets.TroubleID}<> 0 and
{tbl_tickets.OpenDate}>= {?BeginDate} and
{tbl_tickets.OpenDate}<= {?EndDate} and
{tbl_tickets.CustomerAcctNumber}<> '184114' and
{tbl_tickets.TroubleType}= {?TroubleType}

and I need to duplicate it for 3 other parameter fields. Is there a way to nest the case statements - I continually get an error everytime I try add just one other case statement to a new parameter...Not clear. U want to put on case within another?|||Yes -

I need to do this same type of functionality for a total of 4 parameters - and have it interchangeably choose the option selected or all for each individual paramter:

example: Give me all the cities
and just troubletype of -email
with all the status

Or Just this city, with just this trouble with just open status...|||Still I'm not clear. But if you want to nest ur case statements, here is an example

//starts here

select {?state}
case "MN" :
(

select {?city}

case "City A" :
"here is some code for city A"

case "City B" :

"here is some code for city B"

)

case "CA" :
"Here is some code for CA"

case "FL" :
"Here is some code for FL"

No comments:

Post a Comment