Get record count
Posted on 2011-03-24
OK. This one is kind of crazy. I currently have a UNION query made up of 5 tables.
I use the query to produce a report of all records within a date range. Each record is one line on my report.
I need to modify it. What I need to do is get a count of the total records in a population.
The population would be all records within the date range I specify. Let's say I specify a date range of 1/1/2008 thru 12/31/2009 and that returns 100,000 records. I need to be able to display that count (100,000) on my report but not print the 100,000 records.
Of the population, I need to print the most current 500 records.
Like I indicated above, I currently have an existing report I use that prints all records within the date range I specify. What I'm trying to do just display the count (in a textbox or whatever) of the total records that are returned within that date range but only print the most current 500 of them (my tables have a Date Field to identify what is most current)