By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,264 Members | 1,079 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,264 IT Pros & Developers. It's quick & easy.

Date difference in a query

P: 1
I am struggling with a simple task of finding the difference between the earliest date and latest date for records held in a sub-form. The dates are not necessarily always entered in the correct sequence, but the subform data re sorts itself after a new entry has been made so the first date is at the top and the last date at the bottom. Counting the records isn't a problem, but getting the difference betwen first and last date in days is.

Can anyone help me please
Mar 19 '07 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 10K+
P: 12,366
This will give you the difference in days. Use "m" for months.
Expand|Select|Wrap|Line Numbers
  1. DateDiff("d", DMin("[Date Field]", "Table"), DMin("[Date Field]", "Table"))
Mar 19 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.