Hello team,
I want to write two nested case statements:
case1
field1 > field2 and field2> field3 and field3 >field4 then
case1
case2
case3
case2 field1 < field2 and field2< field3 and field3 <field4 then
case1
case2
case3
What would be the syntax? Or is this doable?
Regards,
Bitten
two nested case statement
-
- Administrator
- Posts: 78558
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: two nested case statement
That is not a Case statement, and they are not nested. Use If ... ElseIf ... Else ... End If:
Code: Select all
If field1 > field2 And field2 > field3 And field3 > field4 Then
...
ElseIf field1 < field2 And field2 < field3 And field3 < field4 Then
...
Else
...
End If
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1498
- Joined: 01 Mar 2015, 02:03
Re: two nested case statement
thanks bittenapple