Displaying BS4 Table Generator data from custom SQL query having count

I created a custom query that appears to work when I execute it through the Database Custom Query results. The query is built to show the aggregate count of instances where a certain category code appears anywhere in my cm_agency table. So, for instance in the screenshot you’ll see that Category Code 1 appears once, Cat Code 10 appears 15 times, Cat Code 11 appears 2 times, etc.

However, when I use the Bootstrap 4 Table Generator to display the results, the Count column appears empty.

Here’s a screenshot showing my selections in the table generator’s window.

How do I get the “Count” data to appear?

Hi Matt,

Try giving count an alias in the sql… After Count(*) in the select statement add AS row_count

row_count can be whatever name makes sense for you.

–Ken

That did it!

Thank you so much Ken. I sincerely appreciate your help and speedy response.
I’m such a novice, but this software has been a huge help and the people on this board who give advice are an even bigger help.

7 Likes