[AccessD] Summing Time is missing minutes (fixed typo)

Bob Gajewski rbgajewski at adelphia.net
Mon Jul 12 14:58:47 CDT 2004


Dear Group:

This is a similar issue to the recent one about summing time.

I have two actual fields and one calculated field in each detail record:

	StartTime
	EndTime
	txtTimeDiff (calculated)

On the report, I print the StartTime, EndTime, and txtTimeDiff - all using
Short Time format.

I group and subtotal the data at the deepest level. The detail records show
the true time difference (such as 02:30 for two and one-half hours
difference). PROBLEM: My subtotals and totals for the txtTimeDiff are only
adding the integers (hours); not the minutes (In the above example, it is
only adding two hours). All my fields are set to one decimal place. Any
suggestions where I have gone awry? Below is the code and a sample output:

TIA
Bob Gajewski


REPORT CODE
====================================================
rptMembers
  FullName Header
    IncidentClassMajorName Header
      IncidentClassMinorName Header
        Detail
          [PageNumber] [StartTime] [EndTime] [txtTimeDiff]

txtTimeDiff: IIf([EndTime]>[StartTime],Format([EndTime]-[StartTime],"Short
Time"),Format(DateAdd("d",1,[EndTime]-[StartTime]),"Short Time"))

      IncidentClassMinorName Footer
          [sttlCountIncidentID] [sttlTimeDiff]

sttlCountIncidentID: Count([IncidentID])
sttlTimeDiff: Sum(Val([txtTimeDiff])) Format 0.0

    IncidentClassMajorName Footer
  FullName Footer
    [ttlCountIncidentID]

ttlCountIncidentID: Count([IncidentID])
ttlTimeDiff: Sum(Val([txtTimeDiff])) Format 0.0


REPORT SAMPLE OUTPUT
====================================================
Jones, John
  Drill
    Fire Drill
      19:00  20:00  01:00
      19:00  20:30  01:30
        STTL   2      2.0 hrs       'should be 2.5
    EMS Drill
      23:00  02:00  03:00
      19:30  21:00  01:30
      10:00  15:30  05:30
        STTL   3      8.0 hrs		'should be 9.0
         TTL   5     10.0 hrs		'should be 11.5







More information about the AccessD mailing list