Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
qolkaram
Contributor III
Contributor III

Count Of Records

Hi every one

i am wondering how i can count number of record based on selected items in a list box . suppose the below table and  in the list box i have items (ZONE,SUB_CON_COMPANY,SITE_TYPE) , now based on items selected from list box i want to know number sites

example : zone3 : 12 sites

                 zone3 ,2g :7 sites

                 zone3 ,2g ,PCT :2 sites

SITE_IDS

ZONE

SUB_CON_COMPANY

SITE_TYPE

JLDU057

Zone 3

Siteg

3G

JLD057

Zone 3

Siteg

2G

JLD058

Zone 1

Siteg

3G

JLDU060

Zone 2

Siteg

3G

JLDU061

Zone 3

Siteg

3G

JLD061

Zone 3

Siteg

2G

JLD062

Zone 3

Siteg

2G

JLD063

Zone 2

pct

2G

JLD064

Zone 3

pct

3G

JLD065

Zone 3

pct

2G

JLD066

Zone 3

pct

3G

JLDU067

Zone 1

pct

3G

JLD067

Zone 3

pct

2G

JLDU068

Zone 3

pct

3G

JLD068

Zone 3

Siteg

2G

JLD069

Zone 3

Siteg

2G

thanks for your help

3 Replies
tresesco
MVP
MVP

In a textbox try expression  =Count(ZONE) . Then keep on playing with selection and see the output in the textbox. In fact, if you can use Count(anyfield ), where anyfield has no NULL values.

qolkaram
Contributor III
Contributor III
Author

thanks For your response ,

Actually , in other word i want to know how can i implement the SQL logic( count(*)) with dynamic Group by ,the group by fields should Add based on listbox selected items , so if only Zone selected the group by only include Zone and if Zone and sub_con_company selected then group by should include zone and sub_con_company and so on ..  

Anonymous
Not applicable

Hi,

You can simply write: Count(SITE_IDS). It will dynamically change on the basis of the selection made in your list boxes.

PFA for the same as an example.