Irritating Problem...

G

Guest

Hi,

I have an irritatingly small querie that I'm struggling to write...

I have two columns of data in a table. The data contains letters, numbers
and underscores and also varies in length. The columns are of equal length.

All I want to do is count the number of unique pairs in this data
irrespective of which column the data is in

for example:

Col A Col B
123A 65B
123A 65B
65B 123A
23VCJ_0 65B

These are only two unique pairs in the above data - the first three rows are
one pair and the fourth row is the second.

Any help is appreciated....Rgds Chris
 
M

Michel Walsh

Hi,


SELECT iif(colA <= colB, colA, colB), iif(colA<=colB, colB, colA)
FROM myTable
GROUP BY iif(colA <= colB, colA, colB), iif(colA<=colB, colB, colA)




Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top