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

Date-Time minimum of one record 1

Status
Not open for further replies.

Ox73

IS-IT--Management
Nov 5, 2004
16
I have a report that gives me e.g. 230 records. Of those records there are a total of 200 distinct records if I do a distinct count of them. Within these records I have a date/time value for some of these records most have one date/time stamp but some have a date/time that are different from each other like the first date/time is the first date/time when it was updated but when there are more changes done to that record it generates another date/time. I want to count only those with the first date/time to calculate the percentage. My problem is that when I group by the record and then try to evaluate the unique date-time by choosing the minimum date-time for that group record it does not allow me to summarize an already summarized field and ideas? help
 
Do a running total that counts the number of records with a data-time equal to the minimum date-time. Use this to calculate the percentage.

Right-click on a field and choose Insert to get a choice of Running Total or Summary. Or else use the Field Explorer, the icon that is a grid-like box, to add running totals.

Running totals allow you to do clever things with grouping and formulas. They also accumulate for each line, hence the name. The disadvantage is that they are working out at the same time as the Crystal report formats the line. You cannot test for their values until after the details have been printed. You can show them in the group footer but not the group header, where they will be zero if you are resetting them for each group.

Summary totals are cruder, but are based directly on the data. This means that they can be shown in the header. They can also be used to sort groups, or to suppress them. Suppress a group if it has less than three members, say. They default to 'Grand Total', but also can be for a group.



[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
If you are counting one date per "record", then that would be the same as the distinctcount of the "record". If you want to count some subset based on the value of the first date, then you can use running totals or other approaches, depending upon what you are trying to co. So, what do you want to do with the dates, once you have identified the minimum per "record"? It would also be good if you identified the field that you are counting as a record, since "record" is a technical term referring to a row.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top