Record count summary

(4 posts) (3 voices)
  1. situ, Member

    Hi

    Is there a clever way to use the value found from dbr.count elsewhere in the report. To be more precise can I use the value calculated value in a dbr.title, dbr.subtitle or dbr.text?

    I don't actually want to display the dbr.count value at the bottom of the table, at the top of the table I want to have some text saying there are x number of results in your query., then display the results.

    I know I could execute the query twice. Once to get the count and once to show the results, this is not ideal when the query itself is time consuming.

    IS there an efficient way? If not could we consider this as a feature request?

    thanks

    Simon

  2. myDBR Team, Key Master

    Hi,
    You cannot directly grab the dbr.count and use it dbr.title/dbr.subtitle as these elements are usually displayed before the actual query is executed.

    If you have a complex query where you need to get additional information (like count) and do not want to re-execute it, you can put the result into a temporary table which you can then use for additional calculations and displaying the actual data.

    --
    myDBR Team

  3. Dev, Member

    Upvote for the same request above and would be great to display the dbr.count in other parts even after query execution.

  4. myDBR Team, Key Master

    Hi,
    you can use a user defined variable to get the number of rows selected in MySQL/MariaDB. See a demo.

    In SQL Server/Sybase you can use the global variable @@rowncount.

    --
    myDBR Team


Reply

You must log in to post.