This topic is locked

Chart Filter without Selecting Fields

11/24/2008 4:08:54 PM
PHPRunner General questions
G
gluckett author

Hi, I have a query where I just want to view 2 fields in the chart:
select sum(visits), visit_type from tbVisits

for a chart., and this works very well.
but... I want to filter based on other columns, like visit_data, visit_namewithout pulling them into my select statement?
I want them to show up in my advanced search...
thanks

gordon

S
steveh 11/24/2008

Yes, same comment from me, needs something akin to the report designer whereby you can choose sum,count,min,max and grouping fields and then have all fields as a where or having......

J
Jane 11/25/2008

Gordon,
you can add these fields to your SQL query and then use on the Advanced search page only for your chart.

S
steveh 11/25/2008

I'll check in a while, but I'm not sure you can, I believe you can only select the where in phprunner from the output fields?
This is the sort of query you want for a chart
select a,b,sum©,count(*)

from mytable

where d=1 and e='fred'

group by a,b

G
gluckett author 11/25/2008

Exactly, I would have to "group by" on the other fields, which would mess up the query. The best option is that I can use the Advanced Search without having to put the fields in the select statement (just the where statement)...but PHPrunner will only reveal those fields that are in the select not the where....
thanks

gordon

I'll check in a while, but I'm not sure you can, I believe you can only select the where in phprunner from the output fields?

This is the sort of query you want for a chart
select a,b,sum©,count(*)

from mytable

where d=1 and e='fred'

group by a,b