Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Case syntax

Status
Not open for further replies.

k9handler

MIS
Dec 13, 2008
17
US
I'm a newbie in Crystal. Currently using Crystal XI. I'm needing to compare invoice numbers and based on the invoice range, assign a "Company Name" whcih is to be used to group a report. My code is

Select {ART_CURRENT__TRANSACTION.Invoice}
Case {ART_CURRENT__TRANSACTION.Invoice} in "100000" to "599999": "Company 1"
Case {ART_CURRENT__TRANSACTION.Invoice} in "600000" to "799999": "Company 2"
Default: "Company 3"

I get a "A string is required here" error message on the Case statement.

I need a correction. Thanks
 
Hi,
The syntax for a Select..CASE formula is:
Code:
Select {Customer.Fax}[1 To 3]
   Case "604", "250" :
      "BC"
   Case "206", "509", "360" :
      "WA"
   Default :
      "";

note that just rhe values to be tested, not the field name are used in the CASE part, so yours should be something like:
Code:
Select {ART_CURRENT__TRANSACTION.Invoice}
CASE "100000" to "599999": "Company 1"
Case  "600000" to "799999": "Company 2"
Default: "Company 3"





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thanks - that solved my problem. This newbie appreciates it!
 
Hi,
Glad to help, we were all newbies once ( Oh so long ago...[sadeyes])

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top