Click to See Complete Forum and Search --> : Nested Cases - is it possible?


fourplet
March 26th, 2004, 12:32 PM
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....

harmonycitra
March 26th, 2004, 01:17 PM
Not clear. U want to put on case within another?

fourplet
March 26th, 2004, 02:43 PM
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....

harmonycitra
March 26th, 2004, 03:50 PM
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"