Question : UNION IN SUBQUERY - MS ACCESS

Query Experts,

I am getting error in this query using UNION in sub query. Please advice.

SELECT  'UNKNOWN' AS GOS, RECORD_INDEX  FROM IDEN_PHONE_DATA WHERE RECORD_INDEX NOT IN (
SELECT Record_Index FROM Iden_phone_data WHERE  Server_RSSI > -120 AND Server_SQE > -1 AND Server_RSSI >= -95 AND SERVER_SQE > 22
Union
SELECT Record_Index FROM Iden_phone_data WHERE  Server_RSSI > -120 AND Server_SQE > -1 AND Server_RSSI < -95 AND SERVER_SQE >= 22
Union
SELECT Record_Index FROM Iden_phone_data WHERE  Server_RSSI > -120 AND Server_SQE > -1 AND Server_RSSI >= -85 AND SERVER_SQE < 22
Union
SELECT Record_Index FROM Iden_phone_data WHERE  Server_RSSI > -120 AND Server_SQE > -1 AND Server_RSSI < -85 AND SERVER_SQE < 22
 )

Answer : UNION IN SUBQUERY - MS ACCESS

Bah - there's a typo or two in there I see.
At the very least the query should begin:

SELECT  'UNKNOWN' AS GOS, Record_Index FROM Iden_phone_data T
WHERE  NOT EXISTS (SELECT ...

(i.e. delete the "Record_Index" after the WHERE predicate)

Random Solutions  
 
programming4us programming4us