KB-31684: Subtracting fields’ values in a Query.

Question:

How can I subtract the values from two different fields of a Query, and then display this result in a report‘s Data Field?

Solution:

To do so, follow these procedures:

1. Create a new field in the Query, to be viewed in the report.
2. Subtract these values on the Query’s SQL tab, and display the result in the new field:

Select Table1.E3TimeStamp , Table1.Field1 , Table1.Field2 , Table1.Field1-Table1.Field2 as TotalField
FROM Table1
ORDER BY Table1.E3TimeStamp ASC

3. Insert a Data Field in the report’s Detail section and, at DataField property, write the name of the new field (TotalField, for example).

If you want to use all variations in Detail section, change  SummaryType property to 1 – ddSMGrandTotal.

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *