count DISTINCT [field1] where [field2]=True (1 Viewer)

CoffeeGuru

Registered User.
Local time
Today, 04:16
Joined
Jun 20, 2013
Messages
121
I am trying to get a distinct count of [FAMILY] where [ACTIVE] = True

I am using SQL server back end with pass through query to create my report. This is I guess important as DISTINCT becomes a valid operator...I think.
 

pr2-eugin

Super Moderator
Local time
Today, 04:16
Joined
Nov 30, 2011
Messages
8,494
Why not GROUP BY?
Code:
SELECT Count([FAMILY]) As CountOfFamilies
FROM yourTableName
GROUP BY [FAMILY]
WHERE [ACTIVE] = -1;
 

CoffeeGuru

Registered User.
Local time
Today, 04:16
Joined
Jun 20, 2013
Messages
121
Sorry my bad

This is in a report footer
 

pr2-eugin

Super Moderator
Local time
Today, 04:16
Joined
Nov 30, 2011
Messages
8,494
Huh??!!?? Could the Report not have a recordsource? Which could be this Query?
 

Users who are viewing this thread

Top Bottom