Tricky Group by with Sort?
Posted on 2008-06-13
I have the following tables:
I need to create a report for my personnel for their listings that gives them a break down of the stats and source count under each. So for example:
The listingStats table can have the source defined from anywhere on the web, so I wont be able to know what that source is, but I need to group by the source as a whole and the count. Your help is greatly apprecited. I have included the table breakdown below and possible query?
Select viewdate, source from tblListingStats where ListingID in(Select ListingID from tblListings where PersonnelID = ListingagentID) Groupby source, viewdate order by ListingID