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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Last 2 Dates - calc in report not query

Status
Not open for further replies.

BHScripter

Technical User
Aug 26, 2002
159
US
Hi,

I have a report which is grouped first by account number and then under that is the cost center. I am getting the monthly average of each cost center for that account.

example:

Account 700000 (telecommunications) (visible)
Cost Center "Builders" (visible)
01/03 $10 (this monthly detail is not visible)
02/03 $10
04/03 $10

Total 30 average 10 (visible)

I need to also show the latest two months dates as well as the actuals for those two months.

I was able to get the max month by using an unbound text box to get the max date.

However, I can't seem to get the next month in line. Also, there may be some months where there were no charges. I need the latest two months with charges. Can I do this in the report rather than in a query since my report contains all the detail it just isn't visible?

Thanks,
Brianna
 
Sort the detail section by month.
In the group header/footer create calculated text boxes and link them to the data in the detail section.
=[TextBoxInDetailSection]

Such textboxes will display the value in the last detail line (last formatted data).

HTH


[pipe]
Daniel Vlas
Systems Consultant

 
That works great for the last record but how do I get the one just before it?

I'm sure it's probably very simple, but I'm not seeing it.

Thanks,
Brianna
 
Hmmm...
I'd think of an array with two elements.
In the Detail format section:

Array(0) = Array(1)
Array(1) = YourValue

When the detail formatting is over, you have the 2 last formatted elements in the array and you can use the values in the Format event of a group section to fill in the appropriate unbound boxes.

HTH



[pipe]
Daniel Vlas
Systems Consultant

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top