Counting Days

jo.stanley

Board Regular
Joined
Apr 13, 2004
Messages
177
HI

I have one table that has two columns with different dates. I want too run a query that will count the number of days between these two dates but I don't know what criteria I should use. I am using Access 2002

:pray:

Thanks

J
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Add an expression field and subtract the smaller date from the larger date in this field. The resulting number will be the difference, in days, between the two dates.
 
Upvote 0
Thanks for that - Im new to Access so unfortunately I need more help. Could you give me an example of what the expression should look like and also where i put the expression.

Many thanks - from a complete novice
 
Upvote 0
Use the DateDiff function in an expression.

eg DaysPassed:DateDiff("d", [FirstDate], [SecondDate])

Replace FirstDate and SecondDate with your field names.
 
Upvote 0
Start a new query in design view.

Add the table that has the two dates you need to see the difference between. Add in whatever fields you'll need to see down the road from this query. Add a new field, and express it like this:

DaysDiff: [date2] - [date1]
where date2 and date1 are the names of the fields holding your date values. When the query is viewed, you will see a new field, named 'daysDiff' (which is arbitrary, you can name it anything) with a value representing the # of days between date2 and date1. It is not necessary to use the datediff() function in this case, as you are just looking for the number of days between two dates.
 
Upvote 0

Forum statistics

Threads
1,221,831
Messages
6,162,250
Members
451,757
Latest member
iours

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top