Distinct Count no fastreport

Asked

Viewed 448 times

3

How to make a Distinct Count in the Fastreport?

I have the report:

Name - sex
John - m
John - m
Maria - f

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

Can anyone help me? That’s just an example. I can’t do one group by in the db because I have several fields.

1 answer

0

As far as I know you have nothing done for it in Fastreports. The Count function does not have parameters to give you just the distinct.

The best thing is to do it in the query, if you don’t want to do 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 might be a little Overkill, but for simple querys, I’d say it worked

Browser other questions tagged

You are not signed in. Login or sign up in order to post.