Working on LibreOffice 4.4.5.2 / HSQLDB 1.8.0.10
Calculated fields are quite easy.. eg; "Field Name1" + "Field Name2" in a third field = a simple sum.
In my database I think I need further calculations from calculated fields within the same query.
These two sql statements are in the same query:
- BuyPrice
- S/H Paid
- TaxPaid
"BuyPrice" + "S/H Paid" + "TaxPaid"
When the query runs, this outputs to a field with an alias of Total Cost
- SellPrice
- S/H Charged
"SellPrice" + "S/H Charged" - ( "SellPrice" * 0.132 + "S/H Charged" * 0.132 )
This outputs to a field with an alias of NET
This is exactly what I need, however I also need a third calculated field for Profit. I cant just enter "NET" - "Total Cost". If I create another query on top of the first one, I can reference the aliases and it works just fine but I can only get this into two separate "Table Controls"
Should this possibly be separate queries??
I simply don't know enough about any of this to get it to work.. any help or suggestions would be greatly appreciated