Re: Query:When 1 field in a table is not = to another field (same tab





WHERE fieldA NOT IN( fiedlB, fieldC)





or



WHERE NOT( fieldA IN(fieldB, fieldC) OR fieldB IN(fieldA, fieldC) )


if fieldB can play the role of fieldA.


Sure, it could be better to have a normalized design:


SELECT id, fieldA as color FROM myTable
UNION ALL
SELECT id, fieldB FROM myTable
UNION ALL
SELECT id, fieldC FROM myTable



saved as, say, qu1, then


SELECT id, color
FROM qu1
GROUP BY id, color
HAVING COUNT(*)=1


would be more conventional. Indeed, if there is only one record for a given
couple {id, color}, it is because that color is alone, not mentioned in
another of its associated fields, and "association" being carried by "having
the same id" concept.




Hoping it may help,
Vanderghast, Access MVP



"Paul (TRX)" <PaulTRX@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:8F300F40-F4FB-459E-9105-9892FC7500D8@xxxxxxxxxxxxxxxx
Does anybody know how I can do the following? I want to query a table to
find
when one field in that table does not match one of two other fields. The
table in question pulls together data from several sources, and we want to
find results where the one field does not have the same info as one or the
other of the other two similar fields.

For example, say we are discussing favorite color. Field A has it as
"blue."
If field B or C, or both also have it as "blue," we don't want to see that
in
our results. If field A has it as "blue" and neither B or C have it as
blue,
we want to see those results. Can this be done, and what would be the
easiest
way? Thank you in advance for any help you can provide.

--
Have a nice day!

~Paul
TargetRx
The power to know what comes next.

~~~~~~
| |
|c--OD
| _)
| |
|-. |
/ `-# /A
/ /_|..`#.J/
||LJ `m''''
ptaylor



.



Relevant Pages

  • Re: Percentage at group level of Crystal Report.
    ... FieldC is a formula field, dividing FieldA by FieldB. ... > as to how to create a group level value for FieldC, ...
    (microsoft.public.vb.crystal)
  • Pivot Grand total on Selected columns only
    ... each day has 4 data fileds (fieldA, FieldB, fieldC, FieldD)+ extra ... i need to find a way of showing Grand total which sum up ONLY ...
    (microsoft.public.excel.programming)
  • Forms & Calcs & Populating a table
    ... Does anyone know whether or not this is possible without writing code for it. ... Now back on the form, FieldC is set up, for the moment, to visually display the product of FieldA and FieldB through the Control Source in Properties being set to do a calculation. ...
    (microsoft.public.access.forms)
  • Re: Percentage at group level of Crystal Report.
    ... >I have three fields on a Crystal report, FieldA, FieldB and FieldC. ... At a group level, I ...
    (microsoft.public.vb.crystal)
  • Re: insert variables into Query
    ... Learning SQL and Access ... from tableX ... fieldA <= tableY.EndDate ... fieldB>= tableY.EndDate ...
    (microsoft.public.access.queries)