G
Guest
I have a report in which I am attempting to calculate elapsed time. One being
the start of work on a job, the second being the completion of the job. The
start time and the end time are entered through a form which creates a record
for each event. In my report I group the two events by day and sum them using
the sum function. In order to force subtraction (subtracting the starting
time from the ending time) I multiply the beginning time by -1 which results
in a minus number. When the report adds the two it does not recognize the
negative number and sums them together as if they were both positive. I use
the following routine to calculate the negative value: IIf([Start]="Y",
((CDbl([Trak_Date_Time]))*-1), CDbl([Trak_Date_Time]))
Where: Trak_Date_Time is date/time. I use CDbl to convert date/time to a
double precision value and multiply by minus 1 to get a negative number for
the stating time.If I manually subtract the converted sarting time from the
end time I get the correct elapsed time. On my report the the end time
appears as a positive and the start time appears as a -. Summing the two
should result in elapsed time. Sum does not recognize the negative value and
adds both together disregarding the minus sign. I'm at a loss. Anyone have a
suggestion?
the start of work on a job, the second being the completion of the job. The
start time and the end time are entered through a form which creates a record
for each event. In my report I group the two events by day and sum them using
the sum function. In order to force subtraction (subtracting the starting
time from the ending time) I multiply the beginning time by -1 which results
in a minus number. When the report adds the two it does not recognize the
negative number and sums them together as if they were both positive. I use
the following routine to calculate the negative value: IIf([Start]="Y",
((CDbl([Trak_Date_Time]))*-1), CDbl([Trak_Date_Time]))
Where: Trak_Date_Time is date/time. I use CDbl to convert date/time to a
double precision value and multiply by minus 1 to get a negative number for
the stating time.If I manually subtract the converted sarting time from the
end time I get the correct elapsed time. On my report the the end time
appears as a positive and the start time appears as a -. Summing the two
should result in elapsed time. Sum does not recognize the negative value and
adds both together disregarding the minus sign. I'm at a loss. Anyone have a
suggestion?