1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

MS Access - filter to a report

Discussion in 'Business Applications' started by plucnik, Sep 23, 2003.

Thread Status:
Not open for further replies.
  1. plucnik

    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
     
  2. downwitchyobadself

    downwitchyobadself

    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.
     
  3. plucnik

    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:
     
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 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/166804

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice