This topic is locked

Edit Sql syntax not working

8/8/2007 4:34:07 PM
PHPRunner General questions
F
frocco author

Hello,
In PHPRunner 4.1 (288)
the following causes an error, limit is not allowed.
select count(id) as PO_Count, Vendor

From master

Where completed='Open'

Group by Vendor

Order by PO_Count desc

LIMIT 5
Regards,
Frank

Sergey Kornilov admin 8/9/2007

Frank,
you need to remove ORDER BY (there is a separate field for this on SQL Query tab).

You might need to remove LIMIT clause as well.

F
frocco author 8/9/2007

Sergey,
I removed the order by clause and it still complains with the limit.
If I do not use the limit 5, it returns too much data for the chart to display properly.
Thanks
Frank

F
frocco author 8/9/2007

Sergey,
I got around this by tacking the Limit 5 on before the SQL is executed.

function BeforeQueryChart(&$strSQL)

{

$strSQL .= ' LIMIT 5';

}


Regards,
Frank