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!

My if then else logic is unwieldy 2

Status
Not open for further replies.

elpico

Programmer
May 14, 2003
19
0
0
GB
Hi all,

I haven't been able to find out how to improve this, but basically I've got my if statement, of which there are over 100 types, but I want to access a condition for everything but 2 or 3 things...

ie
if queueid <> 57 or queueid <> 83 or queueid <> 84 then
do stuff
else
do other stuff

This doesn't seem to work - any idea if you can have logic like this (ie, I don't want to have nested queries)

I've tried it with a Select Case statement, but that doesn't seem to work either.

Any help much appreciated.

Cheers,
e.
 
Hi
How about the other way round?
if queueid = 57 or queueid = 83 or queueid = 84 then
do other stuff
else
do stuff
end if
 
Hmmm, I feel stupid now - Thanks for that!
 
Try this:
If queueid <> 57 And queueid <> 83 And queueid <> 84 Then
do stuff
Else
do other stuff
End If

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top