Selecting Specific Records for a Report
I have a report that requires 16 unique records to be displayed when the report is run. The table holds thousands of records but the Daily Report only wants the records that have 16 unique entries for that specific period. Is it possible to select these records only ? Cannot be by date because the entries could have been made anytime during the past 24 hours.
Can you filter it with your max(readingfield)
and, perhaps, a case statement.
Case "West" : "A''
Case "East" : "B"
or use Wallie's idea of an "in" statement
Maybe you can use max(readingfield) in a sub select
of the where clause.
where table.date = (select max(readingfield) from table)
or, if each meter has a different max(readingfield) , then pull each one
or, create a view that pulls in the TOP 16 meters and link that
to the table. This should work if all else fails.
I hope this helps,