>>Hi,
>>
>>I am trying to count unique values in the field (using SQL Select) if the value is greater than 0
>>
>>So, here is syntax I use (simplified) (which generates an error):
>>
>>select count( case when mytable.myfield = 0 then 0 else distinct( mytable.myfield ) end ) as TotCount
>>
>>
>>What is wrong in the above syntax?
>>
>>TIA
>
>Not sure I understood correctly, maybe you are looking for something like:
>
>
>select (myField), COUNT(*) from myTable where myField <> 0 group by 1
>
As I replied to Rick, I cannot exclude the records where myField is 0. I need them also in the report.
Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham