Hours Calculation

B

Brent

I have a questoin that is way over my head. I trying to report out of a
database for a time and materials tracking software my company purchased.
I need to calculate the number of working hours beteween 2 dates and times
only they are stored in seperate fields. Ex sdate, stime, edate, etime. To
make matters worse on my novice end the time is stored in decimal
format(example 1:30PM is stored as 12.50). Anyone got an idea for what
code could calculate the working hours difference in these times. Our
working hours are 8:00AM to 5:00PM.

Thanks
Brent
 
R

Roger Carlson

Date/Time fields are actually stored as double precision numbers. For
instance, right now, the date and time is:
38391.40049

Where 38391 represents the date (38391 days since Dec 31, 1899) and the
decimal (.40049) represents the time as a fraction of a day. This is how
they are actually stored. Access has a LOT of functions designed to
maniuplate these values.

Look in Help under DateDiff, DateAdd, DateSerial, and CDate. You can also
Format your date for display in a variety of formats. Look up the Format
function as well.

If you are storing your dates in Text fields, I would advise you to change
them to date/time fields. It makes date and time calculations much easier.
--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
B

Brent

Thanks
Roger Carlson said:
Date/Time fields are actually stored as double precision numbers. For
instance, right now, the date and time is:
38391.40049

Where 38391 represents the date (38391 days since Dec 31, 1899) and the
decimal (.40049) represents the time as a fraction of a day. This is how
they are actually stored. Access has a LOT of functions designed to
maniuplate these values.

Look in Help under DateDiff, DateAdd, DateSerial, and CDate. You can also
Format your date for display in a variety of formats. Look up the Format
function as well.

If you are storing your dates in Text fields, I would advise you to change
them to date/time fields. It makes date and time calculations much
easier.
--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

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