(Converting Time) Now here's a question worth answering! ;)

Benjamin Bolduc

Registered User.
Local time
Today, 12:15
Joined
Jan 4, 2002
Messages
169
Hey Everyone!

I'm working on a new report for a new form that I just finished. There's one problem though. I need to use Hours and Minutes on my form but on the report I need to convert the Hours to Minutes.
I have it set up so that there is a [StartTime] and a [EndTime]. Both of these have a value list with 1:00- 24:00 to choose from.
So now I'm sitting here wondering if there's a way to convert
[EndTime]-[StartTime] to equal 237 ,or so, minutes.
So if production starts at 7:00 and ends at 15:00 it will spit out 480 minutes.

If anyone can help me I'd greatly appreciate it. I'd even say Thank You, and give you the satisfaction of knowing you did something nice for someone!
wink.gif
 
I'll even let you do something nice for yourself, too:
Look up the DatePart() function in Access help. Separating out the "h" part of your equation, multiplying by 60, and adding the minutes part should give you the result you want.
 
That may sound really easy to someone as smart as yourself, but it confuses the heck out of me. I can't figure out what the DatePart feature does, the Access Help file isn't very helpful at all.
I bet if you were a little more specific I would catch on.

Thanks so much!
smile.gif
 
Well, I already closed the example I had made, but the field was something like:
Code:
ElapsedTime: [EndTime] - [StartTime]

ElapsedMinutes: DatePart("h",[ElapsedTime]) * 60 + DatePart("n",[ElapsedTime])

Note that it has to be DatePart("n" because "m" is the shortcut for months.

And I'm not that smart, just determined.
Getting a good book on Access helps too.

Good luck,
David R

[This message has been edited by David R (edited 04-09-2002).]
 

Users who are viewing this thread

Back
Top Bottom