This is a migrated thread and some comments may be shown as answers.

query string using count to filter in the report - Q1 2013

1 Answer 27 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Wdson
Top achievements
Rank 1
Wdson asked on 21 Oct 2015, 02:30 PM

olá! Tenho uma consulta no mysql que faz uma contagem da quantidade de inscrições. Mais no relatório está contando todos os itens da cosulta sem aplicar o filtro. Exemplo: 

SELECT
d.department,  
COUNT(d.cod_department) AS total_professionals

FROM department d
INNER JOIN professionals p ON d.cod_department = p.cod_department

where d.cod_business = 1

GROUP BY d.department 
ORDER BY d.department; 

 

run in mysql it returns:

cod_business      department         total_professionals
1                          department 1      32
1                          department 2      10
1                          department 3      15

no relatório substituindo a clausula where pelos filtros, é gerado o seguinte:

cod_business      department         total_professionals
1                          department 1      ​50
1                          department 2      ​70
1                          department 3      ​20​

 

the report returns the company departments '1', but makes the count in all businesses.

the filter is not being applied in the count.​

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 23 Oct 2015, 03:59 PM
Hi,

Thank you for your interest in Telerik Reporting. The official language used for our correspondence with clients is English, so we would appreciate if you continue this discussion in English.

On your question, please test using the Query Builder and test the SQL query. If you need to parameterize the query, the SQL parameters can be mapped to report parameters with the settings from the SqlDatasource Wizard article.
Verify you are using the latest Telerik Reporting Q3 2015 v9.2.15.930 and check what queries are executed over the database when running the SqlDataSource Wizard preview.


Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Wdson
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or