Adding to Time

S

Scott

I have a field called "BeginDateTime" that is medium time format. I'm trying
to create a statement that would add 5 minutes for example to my record.

10:02 AM + 5 minutes = 10:07 AM

I tried saying :

Format([BeginDateTime]+5,"Short Time")

but this has no effect. Can someone point to an example?
 
A

Andrew Smith

Time is stored as a fraction of a day. Your formula is adding 5 days to the
time, so the time part stays the same! There are 1440 minutes in a day, so
to add 5 minutes add 5/1440.
 
D

Douglas J. Steele

Use the DateAdd function:

Format(DateAdd("n", 5, [BeginDateTime]), "Short Time")

Note that you use n for minutes (m is for months)
 

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