Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

limiting the number of grouped records in a query 1

Status
Not open for further replies.
Aug 21, 2001
5
US
Is there a way to run a query to limit the number of Grouped records in a query to 12. I work in real estate and have 100+ different properties. each month I enter financial statements for each property and some properties may have 40 or more records. I need to run calculations on a each property with just the last 12 months of financial data. Date manipulation won't work as I do not also have the just recent months financial statements for each property. Thanks for any help. Jim
 
Example:

SELECT Top 12 FileList.FileCreatedTime, Count(FileList.FileType) AS CountOfFileType
FROM FileList
GROUP BY FileList.FileCreatedTime;


Note! Top 12 is possibly to set only in SQL.

Aivars

Look at thread705-102904 for function what creates SQL with top value by VBA coding.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top