SQL count not working


on a certain page (let’s call it PAGE_2) of my app, I can set a text-field-value to COUNT the records of a certain GoogleSheet-tab based on a criterium.
What I did:

  • filtering the database (when connecting) with the criterium
  • add a table on my page, linked with the (filtered) database
  • action to set text / property / rows count.

I get the correct result, so OK.

But now, I want to put a textfield on another page (let’s say PAGE_1) that must show the count of the records like on PAGE_2, without opening page_2.
I tried :

  • add a text-field, linked to the unfiltered database from my Google-sheet-tab (= all the records)
  • add an action (Page_1 - ENTER - Set SQL Query) with script-code "select count(*) from data where actief_J_N="J"" (actief_J_N is a field in my database).
    But I don’t get any result (empty field).

What am I doing wrong?


Try this query (pma_id is the internal primary key):

select pma_id, count(*) from data where actief_J_N="J"

Check the example sql_count.pma (18.0 KB)

Thanks, and that’s OK.

To help other users, I changed your example with the same counter on page 1, so without opening page 2
sql_count_wim.pma (18.2 KB)

Back to Flipabit >
Copyright © 2018. Flipabit Team. All rights reserved.