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

Voyager

Registered User.
Local time
Today, 04:47
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.
 
Date fields show a point in time. They are not intended to show elapsed time. because they show a point in time, they observe a 24 hour clock. You can use military time to show the hours 0-23 but at 24, the day changes.

You can keep the time as an interger that holds minutes and then convert to hours and minutes for display or use two fields, one for hours and one for minutes. Is this display only data or do you expect to update it? Where does the data come from? How is it stored there?
 
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