and or

  • Very basic question here, but I am very new to SQL. I have this statement in my stored procedure but it tells me there is an error near and

    WHERE Staff_Type = "I" or "P" AND Status = 1

  • Use the in operator. Change this to

     

    WHERE Staff_Type in ('I', 'P')

  • u r missing the name of yr fld in the query:

    WHERE (Staff_Type = 'I' OR Staff_Type = 'P') AND Status = 1

    u may also rewrite the above as:

    WHERE Staff_Type IN ('I', 'P') AND Status = 1

     

     

  • Also make sure you use single quotes and not double....







    **ASCII stupid question, get a stupid ANSI !!!**

  • Thank you all!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply