Counting the product delivery

Hi, I have two tables namely tblProduct and tblDelivery with the following definition:

tblProduct - pid,pdesc
tblDelivery - pid,date,time,location

where the keys are bold.

Now I want to construct a sql statement to display pid,pdesc,totalNumberOfDeliveryBasedOnDate sorted by pid, date

Please advice me on how to construct this sql statement.
Who is Participating?
tigin44Connect With a Mentor Commented:
SELECT, P.pdesc, total AS totalNumberOfDelivery
FROM tblProduct P
   INNER JOIN (      SELECT, X.[date], COUNT(*) as total
                        FROM tblDelivery X
                        GROUP BY, X.[date])  D ON =

ORDER BY, D.[date]
select, a.desc, count(, from tblProduct a, tblDelivery  b where = group by
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.