DBxtra Documentation

DBxtra Documentation

How Can We Help?

Constants in Queries

< All Topics

Sometimes you might need Constants in Queries – which may vary from time to time – in his DBxtra Queries.

We built a sample query object explaining how to do that – CONSTANTS Sample – Invoices Detail {MXN to EURO, USD & YEN}.

1.- We created a new Query Object (Constants Table) which points to the Data Connection and where we declare a list of constants.

Here is the Query “Constants Table”:

2. We selected a table – any table is good – from the data connection and assigned a TOP 1 for it.

  • Right click on the Diagram Pane and select Edit.

3. We created an Expression with Constant values and assigned an Alias name.

4. We saved the Report Object as “Constants Table”.

5. We created a new Query named “Invoices Detail {MXN to EURO, USD & YEN}” adding all required tables and also the DBxtra query “Constants Table”.

Note! The object “Constants Table” does not have any relationship to any other table.

6. We added expressions to calculate on the Constant.

The Expression:

((tbl_Invoice_Sub.Unit_Price – tbl_Invoice_Sub.Discount) * tbl_Invoice_Sub.Qty) / [Constants Table].EURO

The Result shown in the Data Grid:

Previous User – User Group Variables
Table of Contents