View Full Version : Is there an easy way to do this


kirkm
01-26-2010, 02:48 PM
I have a table/column accepting numbers 1 to 15.
Some may be repeated and some may be missing.

I need to know those that are duplicated, or missing.

A CountOf Query is giving me the duplicates, but can you
determine if, e.g. there's no number 14 ?

I could maybe use a code loop but is there a better way using a
query?

Thanks.

vbaInet
01-26-2010, 02:55 PM
In the Query Wizard there is a query for finding duplicates. You can use that then use a UNION to join it up with a SELECT statement that has a WHERE Is Null line

gemma-the-husky
01-26-2010, 03:19 PM
to find the missing values either

a) iterate a recordset in code, testing each value or
b) have a predefined table with values 1 thru 15, and do an unmatched query against that.

hardy1976
06-08-2010, 12:53 AM
to find the missing values either

a) iterate a recordset in code, testing each value or
b) have a predefined table with values 1 thru 15, and do an unmatched query against that.

Simple yet so effective, thankyou.

JamesMcS
06-08-2010, 12:58 AM
I'd have gone with a crosstab query, and predifined the column headers 1 to 15, and used the column you want to check as the Count value, missing numbers would be blanks, dupes would show up as 2 and above. But hey it's all good!