|
|
 |
Re: FN-FORUM: SQL help
date posted 11th January 2007 19:44
> I want to run a SQL statement so that I can see how many scores have
> been generated between specific dates and by whom. So essentially my
> form will just allow a user to input a start date and end date. The
> query will then display a list of all Licensees that have scores
> generated between those dates (I don't want to display Licensees in
> this list who have not generated scores in the period). Alongside the=
> list of each Licensee displayed will be the total number of scores
> they've generated.
How about:
SELECT Company, COUNT(ScoreID) AS ScoreCount
FROM tblScores, tblGroups, tblLicensees
WHERE tblScores.GroupID =3D tblGroups.GroupID
AND tblGroups.LicenseeID =3D tblLicensees.LicenseeID
WHERE GeneratedDate >=3D start_date
AND GeneratedDate |
 |
|