Link to home
Start Free TrialLog in
Avatar of grantballantyne
grantballantyneFlag for United Kingdom of Great Britain and Northern Ireland

asked on

If value is not one of statement

Hi.

I have the following IF statement within an ASP page

<% if (Recordset1.Fields.Item("productimage").Value) <> "albafill1.jpg" then %>

My problem is that I would like to check that my productimage value is not equal to "albafill1.jpg" OR "albafill2.jpg"

I am struggling with the correct syntax to check that my value is not equal to more than one value.

Can anyone assist?

Thanks in advance

Grant
Avatar of mvidas
mvidas
Flag of United States of America image

Hi Grant,
You should just be able to use

<% if (Recordset1.Fields.Item("productimage").Value) <> "albafill1.jpg" or (Recordset1.Fields.Item("productimage").Value) <> "albafill2.jpg" then %>

Matt
ASKER CERTIFIED SOLUTION
Avatar of mvidas
mvidas
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of grantballantyne

ASKER

Thanks mvidas,  that worked
Glad to help!