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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Case formula in CR

Status
Not open for further replies.

MacroAlan

Programmer
Dec 4, 2006
135
US
For a heading on a report, the client wants one of 4 headings to appear. This is my first Select Case and I am confused:
Code:
select [highlight]case[/highlight] {tracking_file.Program_Suffix}
case "N"
    select case {tracking_file.f463#loan_status}
        case "A"
            formula="Approved Purchase"
        case "S"
            formula="Submitted Purchase"
    end select
case "Y"
    select case {tracking_file.f463#loan_status}
        case "A"
            formula="Approved Refi"
        case "S"
            formula="Submitted Refi"
    end select  
case else  
end select
I am getting errors I don't understand. It is highlighting the first 'case' word.


Alan
[smurf]
 
Looks like you've written the formula using Basic syntax, but have selected Crystal syntax in the dropdown menu in the formula editor.

Either change the dropdown to Basic syntax, or eliminate the "case" word from the select lines of the formula, which are not needed in Crystal syntax.

Crystal help has several examples of each.
 
Crystal syntax:

select {tracking_file.Program_Suffix}
case "N" :
(
select {tracking_file.f463#loan_status}
case "A" : "Approved Purchase"
case "S" : "Submitted Purchase"
)
case "Y" :
(
Select {tracking_file.f463#loan_status}
case "A" : "Approved Refi"
case "S" : "Submitted Refi"
)

-LB
 
Crystal syntax: If,Then,Else example

If {tracking_file.Program_Suffix} = "N" Then
If {tracking_file.f463#loan_status} = "A" Then
"Approved Purchase"
Else //If {tracking_file.f463#loan_status} = "S" Then
"Submitted Purchase"
Else //If {tracking_file.Program_Suffix} = "Y"
If {tracking_file.f463#loan_status} = "A" Then
"Approved Refi"
Else //If {tracking_file.f463#loan_status} = "S" Then
"Submitted Refi"


Gary Parker
MIS Data Analyst
Manchester, England
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top