Editor Instance sql SUM function addition
Editor Instance sql SUM function addition
wbyers
Posts: 48Questions: 12Answers: 1
is it possible using the an Editor field instance to add several sums and use that as a field, provided you set it to false? Specifcally can I add the sums of several database fields together and use the total as a field. I know we can use 1 mysql function, does editor support something like SUM(field)+SUM(field2) ?
This question has accepted answers - jump to:
This discussion has been closed.
Answers
To clarify I'm trying to add a field from one table to a field from a joined table. Is that doable using the editor php library?
The easiest way of doing this is actually to use a renderer on the client-side.
Allan
Can that be done using the server side Editor php library? I'm just fine on the actual table.
Yes, as of Editor 1.7 you can use SQL functions in the
Field
statements, as long as it is set to read only - e.g.:Allan
can the sum be with a field from the first table and then a joined table field?
Yes - just like you would in SQL add the table qualifier.
Make sure you use the
leftJoin()
method to do the join as well.Allan
thank you