Need Query Help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PenBlast

    Need Query Help

    I need a SQL query that will return row1 and 2. The rule would be "2
    (and only 2) occurences of Store_Number where Forms_Count is not the
    same.

    Store_Number Forms_count
    3 5
    3 6
    4 8
    5 14
    6 2
    6 2
    8 1
    8 1

    I have one in MSSQL that works like a charm:
    SELECT *
    FROM Screening t1
    WHERE (Store_Number IN
    (SELECT t2.store_number
    FROM Screening t2
    GROUP BY t2.store_number
    HAVING COUNT(DISTINCT forms_count) =
    2))

    But, Access doesn't like this query...so how do I need to rewrite it
    to make it Access compatible?

    thanks
Working...