Assistance needed in summing up total hrs if value exceeds more than 24 hrs.

Voyager

Registered User.
Local time
Today, 08:35
Joined
Sep 7, 2017
Messages
95
Hi team,
I am having a table with three fields named Empname, Wdate and totalhrs. I am also having a form with same names. When I choose empname and date in form the third field has to show the sum of totalhrs. Since the totalhrs has the chances of having a time more than 24 hrs. The sum query which I use is not showing correct result. I did try few changes in the sql query which I have but it yielded no results. Could you assist?
 
Convert the totalhrs to second then sum. Divide it by 3600 after.
 
I tried using dsum method still it shows error

Code:
Me.tlhrs.value = dsum([totalhrs],[ottable], “[Empname] = “ & [forms]![otfm]![enme] & and “[wdate]= # “& [forms]![otfm]![edate] & “#”)

Hi Pat Hartman / Arnelgp Data is already stored in a table and I want to display the data in the form. It is stored in Short time format (hh:nn) but when we sun up it might exceed 24 hrs.
However I am getting some error on empname.
 
use this expression:

Me.tlhrs.value=dsum("((hour(totalhrs)*60)+minute(totalhrs))/60","ottable", "[Empname]=" & Chr(34) & [forms]![otfm]![enme] & Chr(34) & " and [wdate]= #" & Format([forms]![otfm]![edate], "mm/dd/yyyy") & "#")
 
Hi arnelgp,
My heartfelt thanks to you. I was breaking my head on this for past few days till you solved it.
 
Youre welcome friend.
 

Users who are viewing this thread

Back
Top Bottom