Subtract dates into hours and minutes, more than 24?

  • Thread starter Thread starter Colin D.
  • Start date Start date
C

Colin D.

Hi, Newbie here, I'm trying to subtract two dates and find the answer in
hours and minutes.
This works for less than 24 hours, =([Last Date Actual]-[Last Date
Scheduled])
but how do I get it to work for more than 24 hours?
Any ideas? TIA, Colin D.
 
Sorry, not enough info is there?
This is in a report and I'm trying to show how many hours lapsed between two
dates, which as I say here is often more than 24 hours.
Colin D.

: Hi, Newbie here, I'm trying to subtract two dates and find the answer in
: hours and minutes.
: This works for less than 24 hours, =([Last Date Actual]-[Last Date
: Scheduled])
: but how do I get it to work for more than 24 hours?
: Any ideas? TIA, Colin D.
:
:
 
Hi, Newbie here, I'm trying to subtract two dates and find the answer in
hours and minutes.
This works for less than 24 hours, =([Last Date Actual]-[Last Date
Scheduled])
but how do I get it to work for more than 24 hours?
Any ideas? TIA, Colin D.

Doug's Diff2Dates custom code is very slick and well worth getting. If
for some reason you need to do it with native Access, you can use the
DateDiff() function to get the difference in minutes:

DateDiff("n", [Last Date Scheduled], [Last Date Actual])

This gives integer minutes ("h" gives integer hours; just in case
you're wondering why "n" means miNutes, it's because "m" means
Months). To get hours and minutes you can use

DateDiff("h", [Last Date Scheduled], [Last Date Actual]) &
Format(DateDiff("n", [Last Date Scheduled], [Last Date Actual]) MOD
60, "\:00")


John W. Vinson[MVP]
 
Thanks Doug & John,
I'm going with John's solution, as I'm more comfortable with "native" Access
and have never learnt any coding methods. Maybe that's something to get
into, when I get enough free time ;-{
Thx again, Colin D.

: On Sat, 7 May 2005 19:53:58 -0400, "Colin D."
:
: >Hi, Newbie here, I'm trying to subtract two dates and find the answer in
: >hours and minutes.
: >This works for less than 24 hours, =([Last Date Actual]-[Last Date
: >Scheduled])
: >but how do I get it to work for more than 24 hours?
: >Any ideas? TIA, Colin D.
: >
:
: Doug's Diff2Dates custom code is very slick and well worth getting. If
: for some reason you need to do it with native Access, you can use the
: DateDiff() function to get the difference in minutes:
:
: DateDiff("n", [Last Date Scheduled], [Last Date Actual])
:
: This gives integer minutes ("h" gives integer hours; just in case
: you're wondering why "n" means miNutes, it's because "m" means
: Months). To get hours and minutes you can use
:
: DateDiff("h", [Last Date Scheduled], [Last Date Actual]) &
: Format(DateDiff("n", [Last Date Scheduled], [Last Date Actual]) MOD
: 60, "\:00")
:
:
: John W. Vinson[MVP]
 
Back
Top