CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual Basic Programming > Crystal Reports
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old March 26th, 2004, 12:32 PM
    fourplet fourplet is offline
    Junior Member
     
    Join Date: Mar 2004
    Posts: 3
    fourplet is an unknown quantity at this point (<10)
    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....
    Reply With Quote
      #2    
    Old March 26th, 2004, 01:17 PM
    harmonycitra harmonycitra is offline
    Member
     
    Join Date: May 2003
    Posts: 163
    harmonycitra is on a distinguished road (20+)
    Not clear. U want to put on case within another?
    Reply With Quote
      #3    
    Old March 26th, 2004, 02:43 PM
    fourplet fourplet is offline
    Junior Member
     
    Join Date: Mar 2004
    Posts: 3
    fourplet is an unknown quantity at this point (<10)
    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....
    Reply With Quote
      #4    
    Old March 26th, 2004, 03:50 PM
    harmonycitra harmonycitra is offline
    Member
     
    Join Date: May 2003
    Posts: 163
    harmonycitra is on a distinguished road (20+)
    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"
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual Basic Programming > Crystal Reports


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 06:15 AM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009