By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,520 Members | 1,268 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,520 IT Pros & Developers. It's quick & easy.

Data subset in report header

P: n/a
I want to include some summary data in a report section header. In the
example below I want to put in the "Apples" section header the date of the
sale of the last red apple. Everything I try only produces the date of the
last record in that section (10/3/05 instead of 10/2/05, in the example).
Is there a way to effectively enter something into a text field with a
meaning like:

max([SaleDate] where [color]=Red)

EXAMPLE REPORT:
Joe
Apples (Red=2 Green=1 Date of Last Red=10/2/05)
10/3/05 Green
10/2/05 Red
10/1/05 Red
Nov 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You can pull the highest date from the table that feeds your report by
adding in an aggregate field to the query you're using. You can use the
MAX() function to take the highest date from your date field and set
the critera to [AppleColorfield]="Red".

Ex: (in the QBE grid)
(Field) LatestRed: MAX([SaleDate])
(Totals) Expression
(Criteria) [color]='Red'

Then every one of your records will have the latest date for red apples
in their LatestRed field. You can bind a textbox to the LatestRed field
in the header of your report.

Another way is to use Domain Aggregate Functions. DLookup, as it were.
This has high overhead, though, so beware.

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.