About hours and minutes

G

Guest

I have a field in a query that shows the minutes, i want to convert its in hours
"Sample" in the field named minutes i see 65 minutes , how to convert it in 1 hour and 5 minutes
Thanks in advanc
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Try this (debug window):

? Format(65\60, "00") & ":" & format(65 mod 60,"00")
01:05

or:

? 65\60 & " hour and " & 65 mod 60 & " minutes"
1 hour and 5 minutes

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQJLoDIechKqOuFEgEQKpMwCeO9EheWnfnbYbunhddfvIZoFGhU4An0eu
ilRp7OeT+RBFyIob22WRtUBv
=7sk0
-----END PGP SIGNATURE-----
 
G

Guest

Thanks a lot it work
now if i have a field called [StartTime] and i wand to add at that time the hour and 5 minutes i've got in the other field, what should i do?
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use DateAdd():

DateAdd("n", OtherField, StartTime)

"n" = minutes.

If OtherField = 65 mins and StartTime = 18:30 (6:30PM) the result of the
above DateAdd will be 19:35 (7:35PM). See the Access VBA Help article
on DateAdd Function for more info.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQJRaRYechKqOuFEgEQL/jwCeKxwoEVze3g0Aovad6xt+L5RD+zsAoM1u
29/ygam/N+4T2FK1gXB4lwjF
=tdFQ
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top