Wednesday, March 28, 2012

HAVING clause?

Hi all,

How would I add:

WHERE Year(tblDetails.DateAdded)=#2003#

... to the SQL statement below?

"SELECT tblDetails.ProductID, tblProducts.ShortDesc, Count(tblDetails.ProductID) AS ProductCount FROM (tblDetails INNER JOIN tblProducts ON tblDetails.ProductID = tblProducts.ProductID) GROUP BY tblDetails.ProductID, tblProducts.ShortDesc ORDER BY Count(tblDetails.ProductID) DESC"

Cheers,
Davidi think the order is


select...
from...
where...
group by ...
having...
order by...
sql

No comments:

Post a Comment