# of days between two dates

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

Is there an expression that I can use in a query to determine the
number of days between two dates?
 
DateDiff("d",earlydate, laterdate)

You might also be able to simply subtract one from the other.
 
Is there an expression that I can use in a query to determine the
number of days between two dates?

DateDiff("d", [first date field], [second date field])

That's inclusive of the first date and the last date.
 
Hello Jim

Try to use the DateDiff function.

In a new saved query, in the design mode, right click a next empty column
and choose "Built" (I think this is the option in English version.).

In the Internal Functions, find DATEDIFF end fill up the fields.

By.

Joe
 
Juzer Jim <[email protected]> napisal

| Is there an expression that I can use in a query to determine the
| number of days between two dates?

You can use DateDiff() function, as mentioned earlier, but...
remember that dates are just numbers od days from "zero" date
(in access: 1899-12-30)
So you can just subtract them:

xDays = Date2 - Date1
or
xDays = Int(DateTime2) - Int(DateTime1)
 
Back
Top