Date field in a query

P

PJ

I have two date fields and I need the number of days from one date to the
other. My fields are [Maturity date] and Date: [Enter a Date]. I want the
number of days between the two. So if the maturity date = 12/31/12 and you
enter a date = 12/31/08. That means on 12/31/08 there are 1461 days before
the maturity date. How would I do that in a query?? Thanks in advance
 
J

John Spencer

Take a look at the DateDiff function or just subtract the two dates

DateDiff("d", [Enter a Date], [Maturity Date])

or

[Maturity Date] - [Enter a Date]

Dates are stored as a number - the number of days since December 30,
1899 (day zero).

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 

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