jfergy
asked on
Tricky Group by with Sort?
Hello-
I have the following tables:
Personnel
ListingStats
Listings
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:
Listing 1234
Google.com 154
Frontdoor.com 25
Listing 1256
Google.com 133
Frontdoor.com 25
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
I have the following tables:
Personnel
ListingStats
Listings
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:
Listing 1234
Google.com 154
Frontdoor.com 25
Listing 1256
Google.com 133
Frontdoor.com 25
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
ASKER
tblListingStats: ID, ListingID, DateTime, Source
TblPersonnel: PersonnelID, FirstName, LastName
tblListings: ListingID, PersonnelID
PersonnelID to tblListings is a 1 to Many relationship
ListingID to tblListingStats is a 1 to many relationship
Thanks for the help!
TblPersonnel: PersonnelID, FirstName, LastName
tblListings: ListingID, PersonnelID
PersonnelID to tblListings is a 1 to Many relationship
ListingID to tblListingStats is a 1 to many relationship
Thanks for the help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks that was awesome!
thanks, you're welcome
which table does PersonnelID and ListingagentID come from?