Jump to content
  • 0

Count Distinct in View


skcombs
 Share

Question

I am trying to count the distinct Client ID numbers from results of searching a view of grants to clients.  The Search Form can limit the results to a specific range of dates or a specific Agency making the contribution, so not ALL the possible client grants.

SELECT COUNT(DISTINCT [@field:ClientID]) FROM _v_tblAgencyContribution   I get a count of all client IDs in the entire view.  I just want a count of the distinct Client IDs in the results.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 1
14 hours ago, skcombs said:

I am trying to count the distinct Client ID numbers from results of searching a view of grants to clients.  The Search Form can limit the results to a specific range of dates or a specific Agency making the contribution, so not ALL the possible client grants.

SELECT COUNT(DISTINCT [@field:ClientID]) FROM _v_tblAgencyContribution   I get a count of all client IDs in the entire view.  I just want a count of the distinct Client IDs in the results.

That should work, maybe try using columnName in the View(it might be different name as Caspio appends table name on the column name sometime) instead of inserting it via Field Picker (DISTINCT ClientID)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...