Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Multiple Values in CASE Post Reply Post New Topic
Author Message
mikebird
Groupie
Groupie
Avatar

Joined: 04 Mar 2008
Location: United Kingdom
Online Status: Offline
Posts: 70
Quote mikebird Replybullet Topic: Multiple Values in CASE
    Posted: 09 Apr 2008 at 5:52am
Here is my current setup for a parameter:

select {?Client}

case "XNORT01" : "North Lambeth"
case "RLBLH05" : "Hostels"
case "RLBLE01" : "Ethelred"
case "RLETT01" : "Lettings First"
case "RHOLL01" : "Holland Town"
case "RCEDA01" : "Cedars"
case "RCROY01" : "CCHA"
case "RSOUT01" : "Southern"
case "RGALL05" : "Gallions"
case "RPENG01" : "Penge"
case "RSWAN02" : "Swan"
case "RPEAB01" : "Peabody"

// FY 07-08 Client Codes

case "RCROY03" : "CCHA"
case "RPENG03" : "Penge"
case "RSWAN03" : "Swan"
case "RHOST04" : "Hostels"
case "RCEDA02" : "Cedars"
case "RETHE02" : "Ethelred"
case "RHOLL03" : "Holland Town"
case "RLETT02" : "Lettings First"
case "RNORT04" : "North Lambeth"
case "RSOUT10" : "Amicus Horizon Croydon"
case "RWAND01" : "Wandle"
case "YSLFH01" : "SLFHA"
case "YSWAL01" : "Swale"
case "YEAST*" : "East Thames"

All I need to do is edit this script to allow for multiple selections. Is it possible? With the CASE syntax, can I add * in the quotes as if using LIKE or can I do an IN selection ["xyz", "abc"] before the colon? Or do I have to do another CASE line with various contents before the colon, and the same contents after it?

eg.
case "XNORT01" : "North Lambeth"
case "XNORT02" : "North Lambeth"


I want to put all sorts in there which OR into the outcome on the right. These reports have been done better without CASE. Easier to modify this one as it stands

or do I have to write all this without the CASE? I'm happy to if necessary for multiple selections.

Thanks
IP IP Logged
jon2ryhme
Newbie
Newbie


Joined: 03 Apr 2008
Location: United Kingdom
Online Status: Offline
Posts: 16
Quote jon2ryhme Replybullet Posted: 09 Apr 2008 at 7:57am
You can do like this one

Select {Customer.Country}
    Case "Canada", "Mexico", "USA":
        "North America"
    Default:
        "Outside North America";
IP IP Logged
jon2ryhme
Newbie
Newbie


Joined: 03 Apr 2008
Location: United Kingdom
Online Status: Offline
Posts: 16
Quote jon2ryhme Replybullet Posted: 09 Apr 2008 at 8:08am

select {?Client}
    Case "XNORT01" ,"XNORT02":
        "North Lambeth"
    Default:
        "Others"

I hope this helps you!
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.