MS Access - filter to a report

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

plucnik

Thread Starter
Joined
Aug 19, 2003
Messages
132
I'm a little new to this so I'm probably going to ask a dumb question...
I'm trying to make a report based on the data in one table. The report is going to identify the amount of late deliveries that a trucking company has made and compare that to the total deliveries in a particular period of time. I'm trying to work out the best way to do this. (I have a limited knowledge of code). The problem that I'm having is how to "count" the total loads while filtering and counting the "late" loads. (I can pretty much figure out the rest). It seems I need to create two queries or a separate table. Is this the right way to do this?
Thanks to all!
Peter
 
Joined
Oct 13, 2000
Messages
941
What you need is called an aggregate or group-by query. You should be able to read up on how they work in Access help.

You use the Count total (that's what goes in the row below the table name) to get the overall, and a formula like this, to find out the "count" of late loads:

LateCount: Iif([DueDte]<[DeliveryDte] Or ([DueDte]<Date() And IsNull([DeliveryDte]),1,0)
Total: Sum

That says, in plain English, if the date due is less than the delivery date, or if the due date is before today and there is no delivery date, count 1, otherwise count 0. You use the sum to get the "total" count.

You'll have to tweak that SQL for your specific fields, of course.
 

plucnik

Thread Starter
Joined
Aug 19, 2003
Messages
132
Thanks for the help with this downwitchyobadself. Right or wrong, I ended up running 2 queries. One to count the total records and the other to filter those results. You know, what ever works.............. :cool:
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top