Time in terms of hours expression in text field.

F

Frank

I have a database the has two time/hour fields. Each field returns short
time data.

I want to create a text box the reflects the difference between the two time
fields in hours and minutes.

For example, if field1(the start field) is 09:00AM and field2 (the end
field) is 02:00PM I want the text box to show: 05:00 elapsed hours.

How do I do this?

Any assistance is deeply appreciated.
 
F

Frank

Thanks for assistance Allen.

Is there a way to return the hours and minutes using your expression? For
example: start 8:00am and end 1:15pm. Should return: 5:15 hours.

Any further help is appreciated.
 
F

Frank

Allen:

Thanks so much for extremely helpful hint relative to this aggravating time
formatting problem. I applied your suggestions based on article at your web
site. Everything works perfectly. Only thing I still have problem with is as
follows:

I have a report that now has a text box which calculates the total time
between start and ending times in terms of hours and minutes. What I
additionally would like to do is create a subtotal field based on above
field that also reflects hours and fractional minutes.

In your professional judgment, what is the best way to do this? Once again,
thanks loads for your guidance.
 
A

Allen Browne

If you have the field named Minutes in the souce query of the report (as
described in the article), you can add a text box to the Report Footer, and
set its Control Source to:

=Sum([Minutes]) \ 60 & Format(Sum([Minutes]) Mod 60, "\:00")
 
F

Frank

Hi Allen:

Thanks once again for great assistance.
I did exactly as you suggested - ie. querry, report, etc. and everything
works wonderfully. Thanks so much again for your time, effort and patience
in addressing my problem.




Allen Browne said:
If you have the field named Minutes in the souce query of the report (as
described in the article), you can add a text box to the Report Footer,
and set its Control Source to:

=Sum([Minutes]) \ 60 & Format(Sum([Minutes]) Mod 60, "\:00")

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Frank said:
Allen:

Thanks so much for extremely helpful hint relative to this aggravating
time formatting problem. I applied your suggestions based on article at
your web site. Everything works perfectly. Only thing I still have
problem with is as follows:

I have a report that now has a text box which calculates the total time
between start and ending times in terms of hours and minutes. What I
additionally would like to do is create a subtotal field based on above
field that also reflects hours and fractional minutes.

In your professional judgment, what is the best way to do this? Once
again, thanks loads for your guidance.
 

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