Report how many old entrys I got.

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

Hi!

I have a table with a Date/time field. When I change a entry,
I update this field to current date/time.

When I run a report I want a field telling me something like:
34% is older then 3 month, calculated from current date/time.

How can I do this??

// peter
 
Peter,

In the detail section of your report, add two unbound text boxes and set
theor visible property to No (you'll just use them for counting old and
total records). Call them, say, RecCount and OldRec, respectively. In their
control source properties, put
=1
=Iif([DateBoxName] < Date()-90,1,0)
respectively. Substitute DateBoxName to the name otf the date text box on
your report; this expression will return 1 if over 90 days old, or 0 if
newer. Set both controls' Running Sum property to Over All.
Then in your report Footer use another three unbound text boxes, visible
this time, and set their control source properties to:
=[RecCount] (to display total number of records)
=[OldRec] (to display number of old records)
=[OldRec]/[RecCount] (to display percentage)

HTH,
Nikos
 
Back
Top