Date field in a query

  • Thread starter Thread starter PJ
  • Start date Start date
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
 
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
'====================================================
 
Back
Top