Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

SQL query with GROUP BY doesn't work, Why?

Post Reply
guscastro
Posts: 10
Joined: Fri Aug 01, 2014 2:37 am

SQL query with GROUP BY doesn't work, Why?

Unread post by guscastro »

I have this code on MYSQL

Code: Select all

SELECT `line`, sum(`value`) FROM `la_quotes` GROUP BY `line` 
Running the query direct on the database, brings the actual result like this..
Line1 986897
Line2 17329271
Line3 3934390
Line4 202100
Line5 3689419

Running the code on a report on nuBuilder do not get SUM,
I wonder what am i missing to amke this totals work on nubuilder?
Line1 22530
Line2 105279
Line3 64080
Line5 101050
Line6 97688

I am running the report with a button with and "onclick" Event nuPrintPDF('01_quotes_by_line');

Please help.

I also notice that if I place the code on the SQL on a form, it doesn't bring the total per `line`
Is it that GROUP BY is invalidated by nubyuilder, If so, what is the turn around.
I would appreciate answer with example.

Code: Select all

SELECT  `line`, sum(`value`) FROM `la_quotes` GROUP BY `line`
Thank you
Image
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: SQL query with GROUP BY doesn't work, Why?

Unread post by admin »

guscastro,

Firstly and most important.. http://forums.nubuilder.cloud/viewtopic.php?f=13&t=8515

Secondly to display sum(value) as a column in the browse you would need to define it (in the Browse Tab)

It won't work anyway because of the First reason.

Steven
Post Reply