Calculating the difference between two dates and times

  • Thread starter chris0309 via AccessMonster.com
  • Start date
C

chris0309 via AccessMonster.com

I have two columns the first "start date and time" the second End date and
Time" is there a calculation to find the difference between the two?

Thanks for helping.

Chris
 
K

KARL DEWEY

Use DateDiff function.
d - days
h - hours
n - minutes
s - seconds
w - weeks
m - months
q - quarters
yyyy - years

DateDiff("d", [Date1], [Date2])
Bear in mind that if your dates are today and yesterday there is only one
day difference, not two. So if you want inculsive you must add one.
 
D

Dow_Jones

Is it possible to return an an answer that includes both years and months?
An example of what I am seeking is:
Start date = 1/1/2000
Today's date = 3/23/2009

I am looking for a formula that states 9 years 3 months. Is this possible?
 
K

KARL DEWEY

Try dividing your units (minutes) by their quanity (60) in the higher time
element (hour) and working the math.

Dow_Jones said:
Is it possible to return an an answer that includes both years and months?
An example of what I am seeking is:
Start date = 1/1/2000
Today's date = 3/23/2009

I am looking for a formula that states 9 years 3 months. Is this possible?
--
The common gavel


KARL DEWEY said:
Use DateDiff function.
d - days
h - hours
n - minutes
s - seconds
w - weeks
m - months
q - quarters
yyyy - years

DateDiff("d", [Date1], [Date2])
Bear in mind that if your dates are today and yesterday there is only one
day difference, not two. So if you want inculsive you must add one.
 
J

Jose

Hi, I'm new to access and I am creating a database where this function would
be very useful. However instead of a difference I need to sum 2 different
time fields in hours:minutes. and display the tolal hours worked. Thank you
 
J

Jose

Please disregard the above messages, I think I found the answer in Access
help. Thanks
 
J

Jose

Actually I tried to get this to work with no success. I will need some help
on this. The database I have displays the attendance of volunteers on a
table that has columns [Day, Time in, Time Out] All volunteers have a up to
3 days of work Friday, Saturday or Sunday for Day, and the time is in medium
time Format. I want to have either a column in the same table that displays
the total hours worked per day, and also if there's a way to have a Total
hours for all days each volunteer worked. The way I have it set up is such
that the attendance and volunteers tables are related through a query (like
was done on the Students template for Access 2007 between students and
attendance). This way each student can have several rows in the attendance
field, but then a sub form displays the attendance for each student only.



Please See the related threads below for more info on this database :

https://www.microsoft.com/office/co...ffice-access&lang=en&cr=US&sloc=en-us&m=1&p=1

&

https://www.microsoft.com/office/co...ffice-access&lang=en&cr=US&sloc=en-us&m=1&p=1
 

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