Query To Count Number of Days on Record

  • Thread starter Winnie Cole via AccessMonster.com
  • Start date
W

Winnie Cole via AccessMonster.com

I need a query to count the number of days between the enteredDate and the
StartDate of each record. For instance one record may show 5/1/05 as the
startdate but show 5/8/05 as the enteredDate. I need a query that would show
that it took 7 days to entered this order.

I have a blank field in the table named "daysToFill" that the count can be
placed in.

Thanks,
Winnie
 
F

fredg

I need a query to count the number of days between the enteredDate and the
StartDate of each record. For instance one record may show 5/1/05 as the
startdate but show 5/8/05 as the enteredDate. I need a query that would show
that it took 7 days to entered this order.

I have a blank field in the table named "daysToFill" that the count can be
placed in.

Thanks,
Winnie

A couple of ways. Take your pick.

DaysToFill:[EnteredDate]-[StartDate]

or..

DaysToFill:DateDiff(["d",[StartDate],[EnteredDate])
 
J

John Spencer (MVP)

Take a look at the DateDiff function

DateDiff("d",[YourStartDate],[YourEnteredDate])

However, you should not store this in your table. Just use the formula to
calculate when needed. That is generally faster and it is more accurate in that
you don't need to make absolutely sure you do the calculation every time the
dates are changed.
 

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

Similar Threads


Top