Toad World® Forums

Add new calculated field


#1

I have a simple query that pulls data from 4 tables in the same database. One of the tables is called “orders”, of which one of the fields is called “total”. I want to create a new field in my query that divides the value in the “total” field by 40, and displays this value in the results.

I went to “QueryBuilder” and selected “Calculated Fields”, defined a new field and set the field definition to be “SUM(orders.total) / .40”, and attached it to the orders table.
When I now select this new field on the orders table so it appears in my diagram and then check it so it is visible in my output report, when the the query is run, it only returns one line in the results (i.e. the most recent order entry in the DB). However, if I unselect the “visible” box, all order entries in the DB are returned.

Any help anyonme can offser as to why this is happening would be greatly appreciated.

Thank you

Jeremy