We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

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

scbauer
scbauer asked
on
Medium Priority
187 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
Comment
Watch Question

Commented:
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

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.