Queries on appgini 5.81
Posted: 2019-11-04 13:06
Hi guys,
I need to understand something, using new "calculated field" function I tried to write this query for calculated field "salesTax":
SELECT ((`order_details`.`UnitPrice` * `order_details`.`Quantity`) *(`order_details`.`tax`/100)) FROM `order_details`
WHERE `order_details`.`odID`='%ID%'
It didn't works because `order_details`.`tax` come from other table (if I use a number instead field works fine).
In the hooks we were use something like that:
$taxSales = sqlValue(
"SELECT taxSales FROM products where ID='{$data['taxSales']}'"
);
How can we use that "sqlValue" in the previous query?
Thanks
I need to understand something, using new "calculated field" function I tried to write this query for calculated field "salesTax":
SELECT ((`order_details`.`UnitPrice` * `order_details`.`Quantity`) *(`order_details`.`tax`/100)) FROM `order_details`
WHERE `order_details`.`odID`='%ID%'
It didn't works because `order_details`.`tax` come from other table (if I use a number instead field works fine).
In the hooks we were use something like that:
$taxSales = sqlValue(
"SELECT taxSales FROM products where ID='{$data['taxSales']}'"
);
How can we use that "sqlValue" in the previous query?
Thanks