R
R Tanner
Hi,
I'm trying to write a query that will return a count of unique Dates
in a table. The following is what I have been trying to use thus
far. I just can't seem to get it quite right. I have found my sub
sql statement will return all records if I select the ID. For
example, if I change the subquery to 'SELECT DISTINCT DAT, RFCID FROM
Instances', it works fine. The only problem being the RFCID column
does not contain unique values.
SELECT Count(*) AS TotalUniqueCalls
FROM Instances
WHERE ID IN (SELECT DISTINCT DAT, ID FROM Instances);
I'm trying to write a query that will return a count of unique Dates
in a table. The following is what I have been trying to use thus
far. I just can't seem to get it quite right. I have found my sub
sql statement will return all records if I select the ID. For
example, if I change the subquery to 'SELECT DISTINCT DAT, RFCID FROM
Instances', it works fine. The only problem being the RFCID column
does not contain unique values.
SELECT Count(*) AS TotalUniqueCalls
FROM Instances
WHERE ID IN (SELECT DISTINCT DAT, ID FROM Instances);