Solved

# Crystal Reports Select Case using Relational Operators

Posted on 2011-04-22
767 Views
I never had to do this before in Crystal but figured it couldn't be too difficult. I need to write a select case statement that is using relational operators. A piece of my Select case looks like this...

Dim K
Dim M

Select Case {@CDOF}
Case (0 < {@CDOF} < 0.25)
If (.5 < {#PDOF})OR ({#PDOF} <= .81) Then
K = 5.495
M = -1.115
End If
Case (0.25 < {@CDOF} < 0.50)
If (.5 < {#PDOF})OR ({#PDOF} <= .81) Then
K = 5.495
M = -1.115
End If
.
.
.

End Select

So pretty much depending on the value of the formula @CDOF, an if statement is executed and the K and M values are filled in...Is this even possible what I am trying to do ???
0
Question by:imonfireDAMMIT

LVL 1

Author Comment

OK I changed this to :

Select Case {@CDOF}
Case 0 To_ 0.25
If (.5 < {#PDOF})OR ({#PDOF} <= .81) Then
K = 5.495
M = -1.115
End If
Case 0.25 _To_ .50
If (.5 < {#PDOF})OR ({#PDOF} <= .81) Then
K = 5.495
M = -1.115
End If

I don't see how to return multiple variables......things that make me go hmmmmmmmmmmmmmmmmmmmm
0

LVL 100

Expert Comment

What are you trying to do?

A formula can only return 1 value but you can set the values of several variable and then use them in other formulas.

mlmcc
0

LVL 1

Author Comment

i wanted to set the value of K and M in this formula and use them in other formulas. Couldn't I do this if K and M are global?
0

LVL 100

Accepted Solution

They are global by default.

May need to add this as the first line of the formulas.
WhilePrintingRecords;

mlmcc
0

LVL 100

Expert Comment

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

## Featured Post

### Suggested Solutions

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
how to add IIS SMTP to handle application/Scanner relays into office 365.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…