Query 2 fields?

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

Access 97

Have a database with the following fields:

Date,#1,#2,#3,text field. (all of the numbers are single
digits).

I want to run a query that will show me all three numbers
based on only two numbers that I am quering for. The
numbers are in random order i.e.,123,213,312,321...

On the above, I would like to query: 23 and have a return
showing all numbers with 23 in them:

DATE # T
1/8/2003 123 E
2/5/2003 325 E
4/8/2002 203 E
8/9/2002 392 E
7/8/2002 932 E
6/4/2002 302 E
4/8/2002 213 E

Thanks.
 
Hi,


Your data does not seem to be normalized, so the criteria is a little
bit weird, something like


WHERE 2=Abs( ([#1] IN(2, 3)) +( [#2] IN(2, 3)) + ([#3] IN(2, 3) ))


assuming (mathematical notation) [#1] <> [#2] <> [#3] <> [#1]

Indeed, x IN( 2, 3) evaluates to 0 or to -1 (-1 if x is either 2
either 3), and since we what the 2 values, there should be two -1 and one
0.




Hoping it may help,
Vanderghast, Access MVP
 
Back
Top