Hi:
I'm working with a DBQuery with a CLOUD_CONNECTOR, if I set a GROUP BY in the Query, I got a SQL syntax error.
Checking the SQL Sentence generated, I saw that the "WHERE" and the "GROUP BY" statements are in incorrect order
This is the SQL Sentence generated for my app:
select medicion.fkPaciente, medicion.fkParametro, medicion.fechaMedicion, SUM(medicion.valor)
FROM medicion
GROUP BY medicion.fechaMedicion
where medicion.fkPaciente= '1' limit 0, 10000
The WHERE statatement corresponds to my CLOUD_CONNECTOR, but is created at the end of the sentence, after the GROUP BY, thus the SQL syntax error.
I found no way to "move" the COLUD_CONNECTOR in the query to the correct position
Regards,
Well, the generated sql should be ok, so there's work for us. But using a group by in conjunction with a cloud variable does not sound logical. Usually, a cloud connector is used from a grid, i.e. an image into a detail, for drill-down purposes etc. With a group by, you can achieve sums and totals, but as these appear in the grid also, you cannot apply a button on those rows. I mean, we haven't have this situation in our test suite, so something to add for sure. We would be helped to know for what purpose you require this construction. Added it to the bug tracker btw.
Re-reading the issue, is it correct that you applied a full sql containing group by in the query? Or did you enter the query by yourself, or set it up with the querybuilder?
Hi
1. The query was created using the Query Builder, setting the "group" and "Function" properties for the group and summary fields, and the cloud connector tab for establishing the filter condition (which results in the WHERE statement)
2. Why a SUM and Group BY?
In this particular case I'm trying to create a kind of dashboard that can be opened from the calling app, to show grids and charts from some other tables. Other cloud connectors in the same app are working, by the way, because this is the only one summarizing some data...
What I'm tryingo to do? I have a master table, a detail table and a "sub-detail" table depending on the detail table. So, 3 leves.
I like to select one record from the master table, show the grid and chart for the detail data, and summarized data from the third level...