add a filter criteria to SQL statement

  • I am trying to add a '<19' filter to the following sql code. And ideas would be appreciated as I am a sql newbie. thanks

    (Select sum(NVL(sh_productivehours,0))

    from schedules_active

    where SH_sid = vw_SID as Scheduled hours

  • Try using AND operation with value < 19

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

  • rlsublime (3/20/2014)


    I am trying to add a '<19' filter to the following sql code. And ideas would be appreciated as I am a sql newbie. thanks

    (Select sum(NVL(sh_productivehours,0))

    from schedules_active

    where SH_sid = vw_SID as Scheduled hours

    Which column or value do you want to test?

    Incidentally, this is a SQL Server forum section, there are other forum sections for Oracle and Access.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

Viewing 3 posts - 1 through 2 (of 2 total)

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