Access Query Question (can't figure out the sql)

Posted on 2009-02-11
Last Modified: 2012-05-06
Hi everyone, I have a query that I just can't figure out.  I have a table that contains the following fields:
GuestID - OfferID - OfferDescription - OfferStartDate - OfferExpireDate - OfferStatus - Field7 - Field8
Field7 and Field8 are booleans (True/False)

There may be multiple records where the first 6 fields are exactly the same, but Field7 and Field8 may differ.  

Let's say, for example, that there are 4 records where the first 6 fields are identical, Field7 is false for each of the 4 records, and Field8 is True in two of the four records.  I would like to "merge" the records into a single record where Field7 is True if any of the 4 records have True as a value for Field7 and False if none of the 4 records are True for Field7.  The same would apply for Field8.

In this instance, I would return a single record where Field7 is FALSE and Field8 is TRUE.

I hope this makes sense.  I know there has to be a way to do it, but I just can't figure it out.

I'm using Access 2003 if that makes any difference (although I don't think it does).

Thanks in advance for any help you can offer.

Question by:scbauer
    1 Comment

    Accepted Solution

    Thanks for reading, but I answered my own question.  For those interested, I realized that Access views True/False as -1/0, so I simply grouped each field except for Field7 and Field8.  For those two, I simply took the MIN value.  In this way, any TRUE value in that field would return TRUE (-1).  The only way it would be FALSE is if they were ALL FALSE (0).

    Hope this helps, the question can now be closed.


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now