P4 Software / cifraHQ

Query Builder

Query Builder

Sometimes a standard report doesn't answer the exact question on the table. Query Builder gives power Users and administrators direct read access to the database — type any SELECT statement, click Execute, and the results appear instantly in a dynamic grid you can export to Excel. It's the fastest path from a business question to a verified answer.

Where to find it

Go to Setup > System > Query Builder.

Query Builder list page in CifraHQ.

Query Builder, your saved ad-hoc Reports against tenant data.

How to run a query

  1. Type your SQL SELECT statement in the query box.
  2. Click Execute.
  3. Results display in the grid — columns are generated automatically from the fields your query Returns.
  4. Click Export to Excel in the toolbar to download the full result set.

Example queries

SELECT TOP 100 Code, Name, Balance FROM Accounts ORDER BY Code
SELECT c.Name, SUM(i.Total) AS TotalSales
FROM Invoices i
JOIN Customers c ON c.Id = i.CustomerId
WHERE i.State = 'Posted'
GROUP BY c.Name
ORDER BY TotalSales DESC

Tips

  • Only SELECT statements are allowed. Data-modification queries (INSERT, UPDATE, DELETE) are blocked — you cannot accidentally change data from this screen.
  • The query runs against your live tenant database. Add TOP N or WHERE filters to limit the result set when working with large tables — an unbounded query on a busy database can be slow and return more rows than you need.
  • Column names in the result grid come directly from your SQL column aliases, so give your expressions meaningful names (e.g., SUM(i.Total) AS TotalSales) to get readable grid headers.
  • If you run the same query repeatedly, turn it into a Widget and add it to a Dashboard — you'll get a live, auto-refreshing view without opening Query Builder each time.
Query Builder provides direct read access to your database. Only grant this feature to trusted administrators.

Related: Widgets · Dashboards · System Logs · Financial Reports · Inventory Report · Audit Trail

Was this page helpful?