Jump to content
  • 0

Sql Statement To List Only Distinct Records In Calculated Fields


cpcbsa

Question

Hello. I am trying to create a summary report with calculated fields however I am having issues with the report. In the big picture I want to do SQL COUNTS to see if data is in a particular field however I want to group those counts by districts. There are 1202 records and 12 districts. I can not make a summary report that calculates totals for the 12 districts. I am learning as I go but I am trying something new... In one of the calculated fields (at this point I tried a new report with only this calculated field to see if I could get 12 DISTINCT records) I am trying to do a SQL DISTINCT command that only pulls the 12 DISTINCT names from the District column in the table. I am not sure if I am missing something in caspio to make this work... here is what I have:

 

SELECT DISTINCT [@field:District] FROM tbl_Charter_Base

 

when I do this in caspio it pulls every record in the 'District' column to total 1202 records instead of pulling only the DISTINCT records (12) 

 

any ideas? Not sure what I am missing... THANKS for YOUR HELP!

Link to post
Share on other sites

1 answer to this question

Recommended Posts

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...