Count unique records

I have a table where each row contains a boolean and a foreign key to another trecord in another table.

I want to know how many distinct foreign keys have false as the boolean - something like this:


SELECT  COUNT(
	SELECT	DISTINCT Table.RecordID
	FROM	Table
             WHERE Table.Bool = 0)
 AS UniqueRecordCount

how would i achieve this?

cheers

monkey


SELECT  COUNT(DISTINCT Table.RecordID) AS UniqueRecordCount
FROM	Table
WHERE Table.Bool = 0

:eek:

2 people, 2 days - every combination except that one!! :blush:

Thanks muchly - we are busy kicking ourselves in the office! :rofl:

Don’t kick too hard… there’s a party tonight! :smiley: