G
Guest
Please help!
I am trying to accomplish 2 distinct counts for two fields in 1 query. Is
this possible? I would appreciate the SQL view accomplishing this.
I currently run 2 queries,
1) grouping by Reg & HH then counting Pol & summing Amt then run
2) grouping by Reg, count HH, sum polcount and amt
For example, my data is as follows 4 fields, Reg, HH, Pol, Amt
Reg HH Pol Amt
NE Bill 2 $10
SW Jane 8 $12
NE Bill 7 $5
SC Rob 3 $50
NE Tim 9 $5
SW Jill 1 $5
The end result of my query would count within each region the distinct # of
HH and # of policies and sum up the amounts
Should be as follows
Reg DistinctHH CountofPol SumofAmt
NE 2 3 $20
SW 2 2 $17
SC 1 1 $50
I am trying to accomplish 2 distinct counts for two fields in 1 query. Is
this possible? I would appreciate the SQL view accomplishing this.
I currently run 2 queries,
1) grouping by Reg & HH then counting Pol & summing Amt then run
2) grouping by Reg, count HH, sum polcount and amt
For example, my data is as follows 4 fields, Reg, HH, Pol, Amt
Reg HH Pol Amt
NE Bill 2 $10
SW Jane 8 $12
NE Bill 7 $5
SC Rob 3 $50
NE Tim 9 $5
SW Jill 1 $5
The end result of my query would count within each region the distinct # of
HH and # of policies and sum up the amounts
Should be as follows
Reg DistinctHH CountofPol SumofAmt
NE 2 3 $20
SW 2 2 $17
SC 1 1 $50