CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    3

    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....

  2. #2
    Join Date
    May 2003
    Posts
    163
    Not clear. U want to put on case within another?

  3. #3
    Join Date
    Mar 2004
    Posts
    3
    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....

  4. #4
    Join Date
    May 2003
    Posts
    163
    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"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured