How to convert the time between to fields into total minutes?

I have an ms access application with two fields the you enter the beginning sampling time and the ending sampling time. THe field that I wanted to have automatically updated this the total sampling minutes is the "total Sampling Time in Minutes Field".
I have tried entering placing formulas in both the Start sampling time and the End Sampling time and only get errors.
Recreate problem

1.      Open application
2.      The application will open to form: frmlSilicSamplingSetup
3.      Click the Sample Setup button
4.      Enter ID: 1
5.      Scroll down to the bottom of the screen until you reach the green section.
6.      In the green section, look for the following fields:
      Sampling Start Time
      Sampling End time
      Total Sampling Time in Minutes

7.      Notice how the field “Total Sampling Time” does not calculate the total minutes of sample time. This is what I cannot figure how to do?  

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dale FyeOwner, Developing Solutions LLCCommented:
I cannot download your database at the moment, but if the two fields involved are of date/time data type, then you should use the DateDiff() function.  Format would look something like:

ElapsedTime: DateDiff("n", [StartDateTime], [EndDateTime])

the "n" represents minutes as "m" represents month

Pawan KumarDatabase ExpertCommented:
How you are calculating minutes ? ...Same as Dale Suggested.. you need to use like below

[Total Sampling Time in Minutes] = DATEDIFF("n",[Sampling Start Time],[Sampling End time])

Refer DateDiff for more details -
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
If the Sample Start Time and Sample End Time have the Date/Time datatype, the above solutions would work for you. Make sure both times have the correct data type.

And in that case you may also try this formula to get Total Sampling Time in Minutes...
([Sampling End Time]-[Sampling Start Time])*24*60

Open in new window

Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

Gustav BrockCIOCommented:
You doesn't need the total field in table. Remove it, and set the ControlSource of the total textbox on the form to:

=DateDiff("n",[Sampling Start Time],[Sampling End time])

Open in new window

That said, you really should read up on how to normalize a database. Your table is a monster, and - as is - it will cause you headaches sooner or later.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cssc1Author Commented:
Thank you all!!
cssc1Author Commented:
Thank you everyone!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.