?
Solved

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

Posted on 2009-02-11
1
Medium Priority
?
180 Views
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.

-Scott
0
Comment
Question by:scbauer
1 Comment
 

Accepted Solution

by:
scbauer earned 0 total points
ID: 23618630
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.

-Scott
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

807 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