If value is not one of statement

Posted on 2005-04-13
Last Modified: 2010-05-18

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

Question by:grantballantyne
    LVL 35

    Expert Comment

    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 %>

    LVL 35

    Accepted Solution

    Please substitute the "or" in my above comment to "and", many apologies

    Author Comment

    Thanks mvidas,  that worked
    LVL 35

    Expert Comment

    Glad to help!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Suggested Solutions

    This is about my first experience with programming Arduino.
    Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now