query help

Hi, I am pretty new to SQL still and having trouble writing this subquery.
I have a query selecting different carriers and I need to filter out carriers with under 20 total loads. And also display more details on the carrier.

Here is what I have:

SELECT
Carr,
SUM(Total_Loads) As Total,
City,
State,
OtherInfo
FROM
MyTable
WHERE
mydate BETWEEN #1/1/2007# AND #12/31/2007#
AND (SELECT
SUM(Total_Loads) As Total
FROM
MyTable
WHERE
mydate BETWEEN #1/1/2007# AND #12/31/2007#
GROUP BY
carr) >= 20
GROUP BY
Carr


Any help would be greatly appreciated. Thank you!
 
Back
Top