Distinct count no fastreport

3

How to make a Distinct Count in FastReport ?

I have the report:

Name - sex
João - m
João - m
Maria - f

In%% normal, the result would be 3, but I want one that takes only the number of rows that do not repeat the name field. In case the result would be 2.

Can anyone help me? This is just an example. I can not do a Count in db because I have multiple fields.

    
asked by anonymous 17.08.2017 / 03:04

1 answer

0

As far as I know you have nothing done for this in FastReports. The count function has no parameters to give you only the distinct.

The best thing to do is to do the query, if you do not want to do the group by you can always do something like

Select a.nome,a.sexo,(Select count(*) from pessoas b where b.nome=a.nome) 'CountDistinct' from pessoas a Where condicao

It may be a bit overkill, but for simple querys, I would say it worked

    
17.08.2017 / 17:17