howto convert 123 minutes to 2:03

  • Thread starter Thread starter DEVOURU
  • Start date Start date
D

DEVOURU

How would ya'll convert minutes to hrs and minutes?

123 minutes is 02:03 (2 hours and 3 minutes).

TIA!,

-JS
 
It doesn't work in a query.
My actual problem is DateDiff("hh:nn",[LunchOut],[ClockIn]) returns #Error,
but DateDiff("n", . . . . works fine returning the minutes. I want to find
the time worked before lunch, and the time worked after lunch. And I thought
this was going to be easy :(

-JS


Duane Hookom said:
Try
Format([YourFieldOrExpression]/1440,"hh:nn")

--
Duane Hookom
MS Access MVP
--

DEVOURU said:
How would ya'll convert minutes to hrs and minutes?

123 minutes is 02:03 (2 hours and 3 minutes).

TIA!,

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

Something like this:

Format(DateDiff("n", #12:00#, #14:00#)\ 60,"00") & _
":" & Format((DateDiff("s", #12:00#, #14:00#) \ 60) mod 60,"00")

Returns 2:00. Replace the # delimited numbers w/ your HH:NN times.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

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

iQA/AwUBQl7iGYechKqOuFEgEQJA+ACglRD4d+dzCMeRmxmNQdp9xsJoIHoAn2Qf
luck9m5TPqsMEDuL+VeWXP/b
=x9mW
-----END PGP SIGNATURE-----
It doesn't work in a query.
My actual problem is DateDiff("hh:nn",[LunchOut],[ClockIn]) returns #Error,
but DateDiff("n", . . . . works fine returning the minutes. I want to find
the time worked before lunch, and the time worked after lunch. And I thought
this was going to be easy :(

-JS


Try
Format([YourFieldOrExpression]/1440,"hh:nn")

--
Duane Hookom
MS Access MVP
--

How would ya'll convert minutes to hrs and minutes?

123 minutes is 02:03 (2 hours and 3 minutes).

TIA!,

-JS
 
Format(DateDiff("n",[LunchOut],[ClockIn])/1440, "hh:nn") should work fine.

If not, what are you getting instead of the time?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



DEVOURU said:
It doesn't work in a query.
My actual problem is DateDiff("hh:nn",[LunchOut],[ClockIn]) returns
#Error, but DateDiff("n", . . . . works fine returning the minutes. I want
to find the time worked before lunch, and the time worked after lunch. And
I thought this was going to be easy :(

-JS


Duane Hookom said:
Try
Format([YourFieldOrExpression]/1440,"hh:nn")

--
Duane Hookom
MS Access MVP
--

DEVOURU said:
How would ya'll convert minutes to hrs and minutes?

123 minutes is 02:03 (2 hours and 3 minutes).

TIA!,

-JS
 
Format does not work in the query. What I have tried in my query is:

Morning: DateDiff("hh:nn",[LunchOut],[ClockIn]) returns #Error
Morning: DateDiff("n",[LunchOut],[ClockIn]) . . . . works fine returning
the minutes.

Thankx for the effort on this one.

-JS


Douglas J. Steele said:
Format(DateDiff("n",[LunchOut],[ClockIn])/1440, "hh:nn") should work fine.

If not, what are you getting instead of the time?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



DEVOURU said:
It doesn't work in a query.
My actual problem is DateDiff("hh:nn",[LunchOut],[ClockIn]) returns
#Error, but DateDiff("n", . . . . works fine returning the minutes. I
want to find the time worked before lunch, and the time worked after
lunch. And I thought this was going to be easy :(

-JS


Duane Hookom said:
Try
Format([YourFieldOrExpression]/1440,"hh:nn")

--
Duane Hookom
MS Access MVP
--

How would ya'll convert minutes to hrs and minutes?

123 minutes is 02:03 (2 hours and 3 minutes).

TIA!,

-JS
 
Are you running the query from inside of Access, or outside of it? If
outside, then you're right, Format won't work. However, if you're running it
from inside of Access, I just tested it, and Format works fine for me.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



DEVOURU said:
Format does not work in the query. What I have tried in my query is:

Morning: DateDiff("hh:nn",[LunchOut],[ClockIn]) returns #Error
Morning: DateDiff("n",[LunchOut],[ClockIn]) . . . . works fine returning
the minutes.

Thankx for the effort on this one.

-JS


Douglas J. Steele said:
Format(DateDiff("n",[LunchOut],[ClockIn])/1440, "hh:nn") should work
fine.

If not, what are you getting instead of the time?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



DEVOURU said:
It doesn't work in a query.
My actual problem is DateDiff("hh:nn",[LunchOut],[ClockIn]) returns
#Error, but DateDiff("n", . . . . works fine returning the minutes. I
want to find the time worked before lunch, and the time worked after
lunch. And I thought this was going to be easy :(

-JS


Try
Format([YourFieldOrExpression]/1440,"hh:nn")

--
Duane Hookom
MS Access MVP
--

How would ya'll convert minutes to hrs and minutes?

123 minutes is 02:03 (2 hours and 3 minutes).

TIA!,

-JS
 
Where did you get
Morning: DateDiff("hh:nn",[LunchOut],[ClockIn])

DateDiff() would expect something like
Morning: DateDiff("n",[LunchOut],[ClockIn])

--
Duane Hookom
MS Access MVP
--

Douglas J. Steele said:
Are you running the query from inside of Access, or outside of it? If
outside, then you're right, Format won't work. However, if you're running
it from inside of Access, I just tested it, and Format works fine for me.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



DEVOURU said:
Format does not work in the query. What I have tried in my query is:

Morning: DateDiff("hh:nn",[LunchOut],[ClockIn]) returns #Error
Morning: DateDiff("n",[LunchOut],[ClockIn]) . . . . works fine returning
the minutes.

Thankx for the effort on this one.

-JS


Douglas J. Steele said:
Format(DateDiff("n",[LunchOut],[ClockIn])/1440, "hh:nn") should work
fine.

If not, what are you getting instead of the time?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



It doesn't work in a query.
My actual problem is DateDiff("hh:nn",[LunchOut],[ClockIn]) returns
#Error, but DateDiff("n", . . . . works fine returning the minutes. I
want to find the time worked before lunch, and the time worked after
lunch. And I thought this was going to be easy :(

-JS


Try
Format([YourFieldOrExpression]/1440,"hh:nn")

--
Duane Hookom
MS Access MVP
--

How would ya'll convert minutes to hrs and minutes?

123 minutes is 02:03 (2 hours and 3 minutes).

TIA!,

-JS
 
Thank you for the replies.
I want to calculate the difference between two short time values from a
table in a query. I can only get minutes, not hours and minutes.
Format(DateDiff("n",[LunchOut],[ClockIn])/1440, "hh:nn") returns "Undefined
function "Format" in expression. I'm puzzled. :(

-JS

Duane Hookom said:
Where did you get
Morning: DateDiff("hh:nn",[LunchOut],[ClockIn])

DateDiff() would expect something like
Morning: DateDiff("n",[LunchOut],[ClockIn])

--
Duane Hookom
MS Access MVP
--

Douglas J. Steele said:
Are you running the query from inside of Access, or outside of it? If
outside, then you're right, Format won't work. However, if you're running
it from inside of Access, I just tested it, and Format works fine for me.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



DEVOURU said:
Format does not work in the query. What I have tried in my query is:

Morning: DateDiff("hh:nn",[LunchOut],[ClockIn]) returns #Error
Morning: DateDiff("n",[LunchOut],[ClockIn]) . . . . works fine
returning the minutes.

Thankx for the effort on this one.

-JS


Format(DateDiff("n",[LunchOut],[ClockIn])/1440, "hh:nn") should work
fine.

If not, what are you getting instead of the time?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



It doesn't work in a query.
My actual problem is DateDiff("hh:nn",[LunchOut],[ClockIn]) returns
#Error, but DateDiff("n", . . . . works fine returning the minutes. I
want to find the time worked before lunch, and the time worked after
lunch. And I thought this was going to be easy :(

-JS


Try
Format([YourFieldOrExpression]/1440,"hh:nn")

--
Duane Hookom
MS Access MVP
--

How would ya'll convert minutes to hrs and minutes?

123 minutes is 02:03 (2 hours and 3 minutes).

TIA!,

-JS
 
Try:
Format([LaterTime]-[EarlierTime],"hh:nn")
If Format() gives you an error then you might have a missing reference.

--
Duane Hookom
MS Access MVP


DEVOURU said:
Thank you for the replies.
I want to calculate the difference between two short time values from a
table in a query. I can only get minutes, not hours and minutes.
Format(DateDiff("n",[LunchOut],[ClockIn])/1440, "hh:nn") returns
"Undefined function "Format" in expression. I'm puzzled. :(

-JS

Duane Hookom said:
Where did you get
Morning: DateDiff("hh:nn",[LunchOut],[ClockIn])

DateDiff() would expect something like
Morning: DateDiff("n",[LunchOut],[ClockIn])

--
Duane Hookom
MS Access MVP
--

Douglas J. Steele said:
Are you running the query from inside of Access, or outside of it? If
outside, then you're right, Format won't work. However, if you're
running it from inside of Access, I just tested it, and Format works
fine for me.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Format does not work in the query. What I have tried in my query is:

Morning: DateDiff("hh:nn",[LunchOut],[ClockIn]) returns #Error
Morning: DateDiff("n",[LunchOut],[ClockIn]) . . . . works fine
returning the minutes.

Thankx for the effort on this one.

-JS


message Format(DateDiff("n",[LunchOut],[ClockIn])/1440, "hh:nn") should work
fine.

If not, what are you getting instead of the time?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



It doesn't work in a query.
My actual problem is DateDiff("hh:nn",[LunchOut],[ClockIn]) returns
#Error, but DateDiff("n", . . . . works fine returning the minutes. I
want to find the time worked before lunch, and the time worked after
lunch. And I thought this was going to be easy :(

-JS


Try
Format([YourFieldOrExpression]/1440,"hh:nn")

--
Duane Hookom
MS Access MVP
--

How would ya'll convert minutes to hrs and minutes?

123 minutes is 02:03 (2 hours and 3 minutes).

TIA!,

-JS
 
Thankx again for the help. I started this database in version MS Access
2003, saved in 2000 compatabilty. I CAN use the Format function without
error and it works. Problem is why not with MS Access 2000, and how to fix?
Thankix again.

-JS

Duane Hookom said:
Try:
Format([LaterTime]-[EarlierTime],"hh:nn")
If Format() gives you an error then you might have a missing reference.

--
Duane Hookom
MS Access MVP


DEVOURU said:
Thank you for the replies.
I want to calculate the difference between two short time values from a
table in a query. I can only get minutes, not hours and minutes.
Format(DateDiff("n",[LunchOut],[ClockIn])/1440, "hh:nn") returns
"Undefined function "Format" in expression. I'm puzzled. :(

-JS

Duane Hookom said:
Where did you get
Morning: DateDiff("hh:nn",[LunchOut],[ClockIn])

DateDiff() would expect something like
Morning: DateDiff("n",[LunchOut],[ClockIn])

--
Duane Hookom
MS Access MVP
--

Are you running the query from inside of Access, or outside of it? If
outside, then you're right, Format won't work. However, if you're
running it from inside of Access, I just tested it, and Format works
fine for me.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Format does not work in the query. What I have tried in my query is:

Morning: DateDiff("hh:nn",[LunchOut],[ClockIn]) returns #Error
Morning: DateDiff("n",[LunchOut],[ClockIn]) . . . . works fine
returning the minutes.

Thankx for the effort on this one.

-JS


message Format(DateDiff("n",[LunchOut],[ClockIn])/1440, "hh:nn") should work
fine.

If not, what are you getting instead of the time?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



It doesn't work in a query.
My actual problem is DateDiff("hh:nn",[LunchOut],[ClockIn]) returns
#Error, but DateDiff("n", . . . . works fine returning the minutes.
I want to find the time worked before lunch, and the time worked
after lunch. And I thought this was going to be easy :(

-JS


Try
Format([YourFieldOrExpression]/1440,"hh:nn")

--
Duane Hookom
MS Access MVP
--

How would ya'll convert minutes to hrs and minutes?

123 minutes is 02:03 (2 hours and 3 minutes).

TIA!,

-JS
 
As Duane said, you might have a problem with your references.

References problems can be caused by differences in either the location or
file version of certain files between the machine where the application was
developed, and where it's being run (or the file missing completely from the
target machine). Such differences are common when new software is installed.

On the machine(s) where it's not working, open any code module (or open the
Debug Window, using Ctrl-G, provided you haven't selected the "keep debug
window on top" option). Select Tools | References from the menu bar. Examine
all of the selected references.

If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



DEVOURU said:
Thankx again for the help. I started this database in version MS Access
2003, saved in 2000 compatabilty. I CAN use the Format function without
error and it works. Problem is why not with MS Access 2000, and how to
fix? Thankix again.

-JS

Duane Hookom said:
Try:
Format([LaterTime]-[EarlierTime],"hh:nn")
If Format() gives you an error then you might have a missing reference.

--
Duane Hookom
MS Access MVP


DEVOURU said:
Thank you for the replies.
I want to calculate the difference between two short time values from a
table in a query. I can only get minutes, not hours and minutes.
Format(DateDiff("n",[LunchOut],[ClockIn])/1440, "hh:nn") returns
"Undefined function "Format" in expression. I'm puzzled. :(

-JS

Where did you get
Morning: DateDiff("hh:nn",[LunchOut],[ClockIn])

DateDiff() would expect something like
Morning: DateDiff("n",[LunchOut],[ClockIn])

--
Duane Hookom
MS Access MVP
--

message Are you running the query from inside of Access, or outside of it? If
outside, then you're right, Format won't work. However, if you're
running it from inside of Access, I just tested it, and Format works
fine for me.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Format does not work in the query. What I have tried in my query is:

Morning: DateDiff("hh:nn",[LunchOut],[ClockIn]) returns #Error
Morning: DateDiff("n",[LunchOut],[ClockIn]) . . . . works fine
returning the minutes.

Thankx for the effort on this one.

-JS


message Format(DateDiff("n",[LunchOut],[ClockIn])/1440, "hh:nn") should work
fine.

If not, what are you getting instead of the time?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



It doesn't work in a query.
My actual problem is DateDiff("hh:nn",[LunchOut],[ClockIn]) returns
#Error, but DateDiff("n", . . . . works fine returning the minutes.
I want to find the time worked before lunch, and the time worked
after lunch. And I thought this was going to be easy :(

-JS


Try
Format([YourFieldOrExpression]/1440,"hh:nn")

--
Duane Hookom
MS Access MVP
--

How would ya'll convert minutes to hrs and minutes?

123 minutes is 02:03 (2 hours and 3 minutes).

TIA!,

-JS
 

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

Back
Top