# of days between two dates

J

Jim

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

Duane Hookom

DateDiff("d",earlydate, laterdate)

You might also be able to simply subtract one from the other.
 
J

John W. Vinson

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.
 
J

Joe

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
 
K

Krzysztof Naworyta

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)
 

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