Discussion Locked

Access 2000 - adding time

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have a form which calculates number of minutes form other fields in the DB. I want to add this number to another field "start time" which is formatted as time. e.g. 07:00 [formatted as time] + 15 minutes [formatted as number]. Is there any wayof doing this, or can I convert the 15 mins to time somehow and add it to the start time? Can you help, I'm running out of time!

9 replies

by adel_ibrahim

do the following:
[start time] + CDate("00.15")
or creat a new text box(formatted as Short Time) and put in the Default Value (CDate("00.15").
you will succeed

regards

by phingers

I couldn't get either of those to work. The first one just returned the start time and the second came up Name?
Is there a way I can use another field name rather than "00:15", because the 15 mins value changes with each record.

by richtee

Use the following value to add 15 minutes to another value that is formatted as time:

0.0104166666666667

This field should also be formatted as time.

Hoep this helps.
Rich

by richtee

As a follow up to my answer #2:

Here is an example for you to use this on a form: Create a new field on your form you want to show as the ?time plus 15 minutes?. If the time you want to add the 15 minutes to is named ?dteFirstTime?, then, use the following as the Control Source for the new field:

=[dteFirstTime]+0.0104166666666667

This new filed will bring back the 'First Time' plus 15 minutes for each record.

If this is not what you want, please add more to your description to clarify your question.

Hope this gets you on your way.
Rich

by phingers

Thanks for your answer - to clarify: I want to add [start time] (format time) to [time taken] (calculated based on other fields and format number). e.g. time taken may be 15 mins, which can be 0.25 or multiplied by 60 to give 15 mins. This value will change, I was using 15 mins as an example, but it could anything.

This discussion is closed to new replies.