CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 How to count

Print topic Send  topic

Author Message
Maddin
Posted: 07/08/2003, 5:22 PM

Hi everybody!

I need to count the number of different entries in a grid.
Example:
Employee-Database

3 worker live in new york
2 worker live in washington
....

is it possible to count those entries in one query?

Greetings from germany
Martin

David Harrison
Posted: 07/08/2003, 5:44 PM

select State, count(EmpId) from EmpDB group by State

Should do the trick.

David Harrison
"Maddin" <m.das@t-online.de> wrote in message
news:befn8h$8t3$1@news.codecharge.com...
> Hi everybody!
>
> I need to count the number of different entries in a grid.
> Example:
> Employee-Database
>
> 3 worker live in new york
> 2 worker live in washington
> ...
>
> is it possible to count those entries in one query?
>
> Greetings from germany
> Martin
>
>

JM
Posted: 07/09/2003, 12:16 AM

There is sample in the CCS FAQ / KB home page on this issue.. It is good
sample
JM

"David Harrison" <davidh@saltydog.net> wrote in message
news:befoho$apq$1@news.codecharge.com...
> select State, count(EmpId) from EmpDB group by State
>
> Should do the trick.
>
> David Harrison
> "Maddin" <m.das@t-online.de> wrote in message
>news:befn8h$8t3$1@news.codecharge.com...
> > Hi everybody!
> >
> > I need to count the number of different entries in a grid.
> > Example:
> > Employee-Database
> >
> > 3 worker live in new york
> > 2 worker live in washington
> > ...
> >
> > is it possible to count those entries in one query?
> >
> > Greetings from germany
> > Martin
> >
> >
>
>

Maddin
Posted: 07/12/2003, 6:54 AM

I get only a blank page when I insert the code from the CCS-FAQ
(http://www.gotocode.com/art.asp?art_id=230&art_content_id=1334&FormArticle_
Page=2&)

I'm using PHP and SQL Server 2000

Greetings Martin


"JM" <alphaces@optushome.com.au> schrieb im Newsbeitrag
news:begfgh$7km$1@news.codecharge.com...
> There is sample in the CCS FAQ / KB home page on this issue.. It is good
> sample
> JM
>
> "David Harrison" <davidh@saltydog.net> wrote in message
>news:befoho$apq$1@news.codecharge.com...
> > select State, count(EmpId) from EmpDB group by State
> >
> > Should do the trick.
> >
> > David Harrison
> > "Maddin" <m.das@t-online.de> wrote in message
> >news:befn8h$8t3$1@news.codecharge.com...
> > > Hi everybody!
> > >
> > > I need to count the number of different entries in a grid.
> > > Example:
> > > Employee-Database
> > >
> > > 3 worker live in new york
> > > 2 worker live in washington
> > > ...
> > >
> > > is it possible to count those entries in one query?
> > >
> > > Greetings from germany
> > > Martin
> > >
> > >
> >
> >
>
>

DonB
Posted: 07/14/2003, 6:56 AM

That sample is now a grid builder option that you specify when creating a
grid or editable grid - "Display the total number of records", which appears
on step4 of the grid builder.

This is not what you requested, as it merely displays the total number of
records found by the query which fills the grid with data.

If you want the grid to list "summary" rows just as you described, one per
state and showing the total employees in that state, then the solution is
simply one of an appropriate query, like that which was described by David
Harrison.

If you want to list each employee, but put a total under each state, then
that is a bit more complicated. You will need to do some programming in the
BeforeRowShow event to sense when you move from one state to the next (you
need a query that does an ORDER BY state) and maintain a variable that
counts the rows so you can output "n workers live in x" when the
current-row's State is different from the previous row's State.

In essence, you will need to create a new row in your table to display the
group total each time you move into a new group ("State").

DonB

http://www.gotodon.com/ccbth


"Maddin" <m.das@t-online.de> wrote in message
news:bep3vf$9c0$1@news.codecharge.com...
> I get only a blank page when I insert the code from the CCS-FAQ
>
(http://www.gotocode.com/art.asp?art_id=230&art_content_id=1334&FormArticle_
> Page=2&)
>
> I'm using PHP and SQL Server 2000
>
> Greetings Martin
>
>
> "JM" <alphaces@optushome.com.au> schrieb im Newsbeitrag
>news:begfgh$7km$1@news.codecharge.com...
> > There is sample in the CCS FAQ / KB home page on this issue.. It is
good
> > sample
> > JM
> >
> > "David Harrison" <davidh@saltydog.net> wrote in message
> >news:befoho$apq$1@news.codecharge.com...
> > > select State, count(EmpId) from EmpDB group by State
> > >
> > > Should do the trick.
> > >
> > > David Harrison
> > > "Maddin" <m.das@t-online.de> wrote in message
> > >news:befn8h$8t3$1@news.codecharge.com...
> > > > Hi everybody!
> > > >
> > > > I need to count the number of different entries in a grid.
> > > > Example:
> > > > Employee-Database
> > > >
> > > > 3 worker live in new york
> > > > 2 worker live in washington
> > > > ...
> > > >
> > > > is it possible to count those entries in one query?
> > > >
> > > > Greetings from germany
> > > > Martin
> > > >
> > > >
> > >
> > >
> >
> >
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.