Calculate 24 hour count

K

Kelly

Hi,
I have a database that I need to count the parts made for that full day of
production. I do have a percentage time for jobs completed active on the
form, but I need also have the count of current pieces produced in since the
past midnight.

Can I do this in a query expression?

Thanks!
Kelly
 
T

Tom van Stiphout

On Tue, 12 Aug 2008 17:10:40 -0700, Kelly

You could create a totals query, something like:
select count(*)
from SomeTable
where FinishDateTime between DateAdd("d",-1,Date()) and Date()

Or you could create a similar expression using the DCount function.

-Tom.
Microsoft Access MVP
 
K

Kelly

Tom, Thank you - I'll give it a try

Tom van Stiphout said:
On Tue, 12 Aug 2008 17:10:40 -0700, Kelly

You could create a totals query, something like:
select count(*)
from SomeTable
where FinishDateTime between DateAdd("d",-1,Date()) and Date()

Or you could create a similar expression using the DCount function.

-Tom.
Microsoft Access MVP
 
K

Kelly

I was finally able to get back into working on the database. I was not
however able to figure out how to do the example in a query. I was able to
Sum the total amout of parts produced, but to get just the last previous
count from the 12:00am the night before I was not.

I have a query based on a table that does have the EndDate & time, but I'm
not sure how to get the last days count only, or a running sum from the
previous midnight.

Thank you,
 
Top