use datediff:
http://msdn2.microsoft.com
You could do:
= [Date1]-[Date2]
or
= DateDiff("d",[Date1],[Date
Good luck
Main Topics
Browse All TopicsHello i have a table with 2 dates (format d-m-yyyy h:mm:s, example: 3-12-2007 9:05:03)
Is it possible to get the days between those dates?
I have the following table:
date1 date2
------------------------ ---------------------
2-12-2007 23:00:00 3-12-2007 9:06:38
1-12-2007 10:24:23 3-12-2007 9:06:38
4-12-2007 23:00:00 10-12-2007 9:06:38
2-12-2007 23:00:00 15-12-2007 10:24:23
2-12-2007 10:24:23 15-12-2007 9:06:38
I want the result like below
date1 date2 days
------------------------ --------------------- -----
2-12-2007 23:00:00 3-12-2007 9:06:38 1
1-12-2007 10:24:23 3-12-2007 9:06:38 2
4-12-2007 23:00:00 10-12-2007 9:06:38 6
2-12-2007 23:00:00 15-12-2007 10:24:23 13
2-12-2007 10:24:23 14-12-2007 9:06:38 12
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
use datediff:
http://msdn2.microsoft.com
You could do:
= [Date1]-[Date2]
or
= DateDiff("d",[Date1],[Date
Good luck
>>i have a table with 2 dates (format d-m-yyyy h:mm:s, example: 3-12-2007 9:05:03)<<
So do the dates have datetime data types? If so they do not have any regional format whatsoever. If they are not and isntead are character data than you will first have to convert to datetime before doing a DATEDIFF.
Business Accounts
Answer for Membership
by: ee_rleePosted on 2008-02-18 at 02:57:10ID: 20918899
hi, use datediff
datediff(day, date1, date2)