I am looking for some assistance in desinging a query that returns the top 4 records for each group. I have a base query that includes HRET_OrganizationID, HRET_MEasureID, Start Date, Numerator, Denominator, and Organization Name. This query serves to pull out the records I am interested in from the larger database.
The query I wrote to pull the top 4 is a select query with the following: HRET_OrganizationID (Ascending), HRET_MEasureID, Start Date (Descending), Numerator, Denominator. Under critieria for Start date I have the following (Select Top 4 [Start Date] from tbl_CDS where [HRET_OrganizationID]=[test21].[HRET_OrganizationID] Order by [Start date] desc)
The result I get is the Top 4 organizations. What I am looking for are the top four months for each group (organization).
Can anyone assist me?
The query I wrote to pull the top 4 is a select query with the following: HRET_OrganizationID (Ascending), HRET_MEasureID, Start Date (Descending), Numerator, Denominator. Under critieria for Start date I have the following (Select Top 4 [Start Date] from tbl_CDS where [HRET_OrganizationID]=[test21].[HRET_OrganizationID] Order by [Start date] desc)
The result I get is the Top 4 organizations. What I am looking for are the top four months for each group (organization).
Can anyone assist me?