Page 1 of 1

Queries on appgini 5.81

Posted: 2019-11-04 13:06
by Anton Mats
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 :roll: :roll:

Re: Queries on appgini 5.81

Posted: 2019-11-05 00:14
by ronwill
Hi, Take a look at this topic, I think it covers what you are asking:
viewtopic.php?f=4&t=3288