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

RE: Else If Statement

Status
Not open for further replies.
Apr 23, 2003
5
0
0
US
I am having problems with getting an Else If Statement to work. The Else If statements separated work properly, but when I put them together my result is 0 if the 1st Else If is false.


If (Isnull({ID}) Or Isnull({Appointment Time})) Then
0
Else If
({ID} = 2 And {Group} = 2) Then
1
Else If
(Isnull({Group}) And {ID} = 2) Then
1
Else
0

-E
 
A bizarre construct anyway.

Note that you are returning the same values in different areas, which may be confusing you:

If Isnull({ID}))
Or
Isnull({Appointment Time}) Then
0
Else if
(
Isnull({Group}) or {Group} = 2
and
{ID} = 2
)
Then
1
Else
0

I simplified this, but of course I have no idea if the formula is going to return what you want.

You'd be better served to take a professional approach to problem solving and post the environment and requirement:

Crystal version
Database/connectivity used
Example data
Exepected output

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top