[AccessD] Question on hours again

Gary Kjos garykjos at gmail.com
Tue Dec 5 14:32:23 CST 2006


Hi Doris,

Do the TimeIn and Time out fields include only times or times and
dates both? I guess if they didn't contain real dates I might
recommend switching them to be jsut a plain text field but then you
have to do a lot of editing and validation of the time values entered
too. So maybe forget about my questioning that.

If you need visibility to minutes level of detail as well as hours
perhaps datadiff would still work with the Minutes interval instead of
the hours one. To get Minutes from datedif you use an n instead of the
h for hours. Can't use m as that means Months.  n=minutes.

I would then accumulate the minutes with the sum as you have been and
then divide the total by 60 to get hours to display in the report. The
problem then is just the remaining Minutes that don't divide evenly
into 60 and how to display those. There is a MOD function that would
do it for that but I wonder if there is an easier way. I guess I would
have two fields displaying in the report footers, one for the hours
part and one for the minutes part with the hours part something like

format((sum(Minutes)\60),'0000') & *:" & format(sum(Minutes) mod 60,"00")

But that is just how I might do it.

Gary Kjos



On 12/5/06, DorisH3 at aol.com <DorisH3 at aol.com> wrote:
> Hi GK,
>
> Yes, my TimeIn and TimeOut fields are Date/Time fields....I also need to
> show the minutes along with the hours.  The DateDiff function did not  work....I
> set it up this way in my query...Hours:DateDiff("h", [TimeOut],  [TimeIn})
> then I reversed the TimeOut and TimeIn fields and that showed a  minus in front
> of the number.....what I am wondering if I could do a function  that would
> convert everything over 24 hrs from days to hours and minutes by  multiplying by
> 1440(24 x 60)....what do you think?
>
> Doris
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


-- 
Gary Kjos
garykjos at gmail.com



More information about the AccessD mailing list