CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 counting found records.

Print topic Send  topic

Author Message
Roger
Posted: 08/01/2001, 12:23 AM

> You may see this is in the BookStore example.
> When you search for books, you will see a message "Items found: 22"
> This is implemented in Books.asp page by adding "Open" event:
> sSQL="select count(item_id) as i_item_id from items as i"
>
> In many cases you can use your own SQL statement instead of the table by
> specifying it in Form properties.

Could not get it to work.

I am using PHP. So I use.
$sSQL="select count(id) as total_id from registration as i";

Please explain total_id & i.
Alias?

No errors but any extra hints why it cannot compute?
--
Rgds
Roger Tng


Alexey Alexapolsky
Posted: 08/01/2001, 4:57 AM

Did you select total_id from field list on a Form ?
"i" is useless

--
Alex

Roger <roger@web4sme.net> wrote in message
news:9k8aoj$6su$1@news.codecharge.com...
> > You may see this is in the BookStore example.
> > When you search for books, you will see a message "Items found: 22"
> > This is implemented in Books.asp page by adding "Open" event:
> > sSQL="select count(item_id) as i_item_id from items as i"
> >
> > In many cases you can use your own SQL statement instead of the table by
> > specifying it in Form properties.
>
> Could not get it to work.
>
> I am using PHP. So I use.
> $sSQL="select count(id) as total_id from registration as i";
>
> Please explain total_id & i.
> Alias?
>
> No errors but any extra hints why it cannot compute?
> --
> Rgds
> Roger Tng
>
>
>

Roger
Posted: 08/01/2001, 11:55 AM

In my page, I have Search, Count(GRID) & List(GRID) forms.
In my COUNT Form, I have ID in field list as LABEL. Total_id (I think it is
an alias) is not one of my fields. So cannot select it.
(I am following the BookStore sample (Books page) very closly.
I put in $sSQL="select count(id) as total_id from registration";

I notice the (BookStore sample) Form Properties has some parameters in the
Input page.
I did not have any. Do I need to? I tried puting ID, and other fields but
still the same - NO COUNT RESULT.

--
Rgds
Roger Tng

"Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
news:9k8qql$8nd$1@news.codecharge.com...
> Did you select total_id from field list on a Form ?
> "i" is useless
>
> --
> Alex
>
> Roger <roger@web4sme.net> wrote in message
>news:9k8aoj$6su$1@news.codecharge.com...
> > > You may see this is in the BookStore example.
> > > When you search for books, you will see a message "Items found: 22"
> > > This is implemented in Books.asp page by adding "Open" event:
> > > sSQL="select count(item_id) as i_item_id from items as i"
> > >
> > > In many cases you can use your own SQL statement instead of the table
by
> > > specifying it in Form properties.
> >
> > Could not get it to work.
> >
> > I am using PHP. So I use.
> > $sSQL="select count(id) as total_id from registration as i";
> >
> > Please explain total_id & i.
> > Alias?
> >
> > No errors but any extra hints why it cannot compute?
> > --
> > Rgds
> > Roger Tng
> >
> >
> >
>
>

wm
Posted: 08/01/2001, 12:10 PM

Hi all,
I am running into the same problem. I am trying to follow the example as
close as possible but I can't get it to work.
I am also interested in how I can get the total to show between the prev and
next links at the bottom of the original grid form.
Thanks,
Walter
"Roger" <roger@web4sme.net> wrote in message
news:9k9jbb$t9b$1@news.codecharge.com...
> In my page, I have Search, Count(GRID) & List(GRID) forms.
> In my COUNT Form, I have ID in field list as LABEL. Total_id (I think it
is
> an alias) is not one of my fields. So cannot select it.
> (I am following the BookStore sample (Books page) very closly.
> I put in $sSQL="select count(id) as total_id from registration";
>
> I notice the (BookStore sample) Form Properties has some parameters in the
> Input page.
> I did not have any. Do I need to? I tried puting ID, and other fields but
> still the same - NO COUNT RESULT.
>
> --
> Rgds
> Roger Tng
>
> "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
>news:9k8qql$8nd$1@news.codecharge.com...
> > Did you select total_id from field list on a Form ?
> > "i" is useless
> >
> > --
> > Alex
> >
> > Roger <roger@web4sme.net> wrote in message
> >news:9k8aoj$6su$1@news.codecharge.com...
> > > > You may see this is in the BookStore example.
> > > > When you search for books, you will see a message "Items found: 22"
> > > > This is implemented in Books.asp page by adding "Open" event:
> > > > sSQL="select count(item_id) as i_item_id from items as i"
> > > >
> > > > In many cases you can use your own SQL statement instead of the
table
> by
> > > > specifying it in Form properties.
> > >
> > > Could not get it to work.
> > >
> > > I am using PHP. So I use.
> > > $sSQL="select count(id) as total_id from registration as i";
> > >
> > > Please explain total_id & i.
> > > Alias?
> > >
> > > No errors but any extra hints why it cannot compute?
> > > --
> > > Rgds
> > > Roger Tng
> > >
> > >
> > >
> >
> >
>
>

Alexey Alexapolsky
Posted: 08/02/2001, 2:16 AM

Please don't put in in sSQL when you can put it into Form
properties/SQL/Custom sql
and then you will definitely see "total" alias in the field list.

--
Alex

Roger <roger@web4sme.net> wrote in message
news:9k9jbb$t9b$1@news.codecharge.com...
> In my page, I have Search, Count(GRID) & List(GRID) forms.
> In my COUNT Form, I have ID in field list as LABEL. Total_id (I think it
is
> an alias) is not one of my fields. So cannot select it.
> (I am following the BookStore sample (Books page) very closly.
> I put in $sSQL="select count(id) as total_id from registration";
>
> I notice the (BookStore sample) Form Properties has some parameters in the
> Input page.
> I did not have any. Do I need to? I tried puting ID, and other fields but
> still the same - NO COUNT RESULT.
>
> --
> Rgds
> Roger Tng
>
> "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
>news:9k8qql$8nd$1@news.codecharge.com...
> > Did you select total_id from field list on a Form ?
> > "i" is useless
> >
> > --
> > Alex
> >
> > Roger <roger@web4sme.net> wrote in message
> >news:9k8aoj$6su$1@news.codecharge.com...
> > > > You may see this is in the BookStore example.
> > > > When you search for books, you will see a message "Items found: 22"
> > > > This is implemented in Books.asp page by adding "Open" event:
> > > > sSQL="select count(item_id) as i_item_id from items as i"
> > > >
> > > > In many cases you can use your own SQL statement instead of the
table
> by
> > > > specifying it in Form properties.
> > >
> > > Could not get it to work.
> > >
> > > I am using PHP. So I use.
> > > $sSQL="select count(id) as total_id from registration as i";
> > >
> > > Please explain total_id & i.
> > > Alias?
> > >
> > > No errors but any extra hints why it cannot compute?
> > > --
> > > Rgds
> > > Roger Tng
> > >
> > >
> > >
> >
> >
>
>

Roger
Posted: 08/02/2001, 12:58 PM

Tried moving to CustomSQL but it keeps giving the grand Total rather than
the Found total.
Used - Select Count(id) as total_id from registration. Filed list total_id
selected.

Give me some hints.
--
Rgds
Roger Tng
"Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
news:9kb5pc$kg$1@news.codecharge.com...
> Please don't put in in sSQL when you can put it into Form
> properties/SQL/Custom sql
> and then you will definitely see "total" alias in the field list.
>
> --
> Alex
>
> Roger <roger@web4sme.net> wrote in message
>news:9k9jbb$t9b$1@news.codecharge.com...
> > In my page, I have Search, Count(GRID) & List(GRID) forms.
> > In my COUNT Form, I have ID in field list as LABEL. Total_id (I think it
> is
> > an alias) is not one of my fields. So cannot select it.
> > (I am following the BookStore sample (Books page) very closly.
> > I put in $sSQL="select count(id) as total_id from registration";
> >
> > I notice the (BookStore sample) Form Properties has some parameters in
the
> > Input page.
> > I did not have any. Do I need to? I tried puting ID, and other fields
but
> > still the same - NO COUNT RESULT.
> >
> > --
> > Rgds
> > Roger Tng
> >
> > "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
> >news:9k8qql$8nd$1@news.codecharge.com...
> > > Did you select total_id from field list on a Form ?
> > > "i" is useless
> > >
> > > --
> > > Alex
> > >
> > > Roger <roger@web4sme.net> wrote in message
> > >news:9k8aoj$6su$1@news.codecharge.com...
> > > > > You may see this is in the BookStore example.
> > > > > When you search for books, you will see a message "Items found:
22"
> > > > > This is implemented in Books.asp page by adding "Open" event:
> > > > > sSQL="select count(item_id) as i_item_id from items as i"
> > > > >
> > > > > In many cases you can use your own SQL statement instead of the
> table
> > by
> > > > > specifying it in Form properties.
> > > >
> > > > Could not get it to work.
> > > >
> > > > I am using PHP. So I use.
> > > > $sSQL="select count(id) as total_id from registration as i";
> > > >
> > > > Please explain total_id & i.
> > > > Alias?
> > > >
> > > > No errors but any extra hints why it cannot compute?
> > > > --
> > > > Rgds
> > > > Roger Tng
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Alexey Alexapolsky
Posted: 08/03/2001, 1:12 AM

I don't know how to count your found total.
It's up to you to decide what condition to use.
Sorta select count (*) from table where some_condition
in your sql statement. It's sql level , not CC level.
If this depends on parameters then you can include them in the query
in "Where" box : where name=" & GetParam("name") & "


--
Alex
Ceritfied CodeCharge Developer
Develop database-connected web sites
without coding: http://www.codecharge.com
ASP, ASP.NET, PHP, JSP, Perl, ColdFusion

Roger <roger@web4sme.net> wrote in message
news:9kcbd3$enk$1@news.codecharge.com...
> Tried moving to CustomSQL but it keeps giving the grand Total rather than
> the Found total.
> Used - Select Count(id) as total_id from registration. Filed list total_id
> selected.
>
> Give me some hints.
> --
> Rgds
> Roger Tng
> "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
>news:9kb5pc$kg$1@news.codecharge.com...
> > Please don't put in in sSQL when you can put it into Form
> > properties/SQL/Custom sql
> > and then you will definitely see "total" alias in the field list.
> >
> > --
> > Alex
> >
> > Roger <roger@web4sme.net> wrote in message
> >news:9k9jbb$t9b$1@news.codecharge.com...
> > > In my page, I have Search, Count(GRID) & List(GRID) forms.
> > > In my COUNT Form, I have ID in field list as LABEL. Total_id (I think
it
> > is
> > > an alias) is not one of my fields. So cannot select it.
> > > (I am following the BookStore sample (Books page) very closly.
> > > I put in $sSQL="select count(id) as total_id from registration";
> > >
> > > I notice the (BookStore sample) Form Properties has some parameters in
> the
> > > Input page.
> > > I did not have any. Do I need to? I tried puting ID, and other fields
> but
> > > still the same - NO COUNT RESULT.
> > >
> > > --
> > > Rgds
> > > Roger Tng
> > >
> > > "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
> > >news:9k8qql$8nd$1@news.codecharge.com...
> > > > Did you select total_id from field list on a Form ?
> > > > "i" is useless
> > > >
> > > > --
> > > > Alex
> > > >
> > > > Roger <roger@web4sme.net> wrote in message
> > > >news:9k8aoj$6su$1@news.codecharge.com...
> > > > > > You may see this is in the BookStore example.
> > > > > > When you search for books, you will see a message "Items found:
> 22"
> > > > > > This is implemented in Books.asp page by adding "Open" event:
> > > > > > sSQL="select count(item_id) as i_item_id from items as i"
> > > > > >
> > > > > > In many cases you can use your own SQL statement instead of the
> > table
> > > by
> > > > > > specifying it in Form properties.
> > > > >
> > > > > Could not get it to work.
> > > > >
> > > > > I am using PHP. So I use.
> > > > > $sSQL="select count(id) as total_id from registration as i";
> > > > >
> > > > > Please explain total_id & i.
> > > > > Alias?
> > > > >
> > > > > No errors but any extra hints why it cannot compute?
> > > > > --
> > > > > Rgds
> > > > > Roger Tng
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Roger
Posted: 08/03/2001, 10:08 AM

I will continue to do more testing.
Meanwhile can you do all of us know what the COUNT SQL feature in the FORM
properties is use d for?

--
Rgds
Roger Tng

"Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
news:9kdmci$n8$1@news.codecharge.com...
> I don't know how to count your found total.
> It's up to you to decide what condition to use.
> Sorta select count (*) from table where some_condition
> in your sql statement. It's sql level , not CC level.
> If this depends on parameters then you can include them in the query
> in "Where" box : where name=" & GetParam("name") & "
>
>
> --
> Alex
> Ceritfied CodeCharge Developer
> Develop database-connected web sites
> without coding: http://www.codecharge.com
> ASP, ASP.NET, PHP, JSP, Perl, ColdFusion
>
> Roger <roger@web4sme.net> wrote in message
>news:9kcbd3$enk$1@news.codecharge.com...
> > Tried moving to CustomSQL but it keeps giving the grand Total rather
than
> > the Found total.
> > Used - Select Count(id) as total_id from registration. Filed list
total_id
> > selected.
> >
> > Give me some hints.
> > --
> > Rgds
> > Roger Tng
> > "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
> >news:9kb5pc$kg$1@news.codecharge.com...
> > > Please don't put in in sSQL when you can put it into Form
> > > properties/SQL/Custom sql
> > > and then you will definitely see "total" alias in the field list.
> > >
> > > --
> > > Alex
> > >
> > > Roger <roger@web4sme.net> wrote in message
> > >news:9k9jbb$t9b$1@news.codecharge.com...
> > > > In my page, I have Search, Count(GRID) & List(GRID) forms.
> > > > In my COUNT Form, I have ID in field list as LABEL. Total_id (I
think
> it
> > > is
> > > > an alias) is not one of my fields. So cannot select it.
> > > > (I am following the BookStore sample (Books page) very closly.
> > > > I put in $sSQL="select count(id) as total_id from registration";
> > > >
> > > > I notice the (BookStore sample) Form Properties has some parameters
in
> > the
> > > > Input page.
> > > > I did not have any. Do I need to? I tried puting ID, and other
fields
> > but
> > > > still the same - NO COUNT RESULT.
> > > >
> > > > --
> > > > Rgds
> > > > Roger Tng
> > > >
> > > > "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
> > > >news:9k8qql$8nd$1@news.codecharge.com...
> > > > > Did you select total_id from field list on a Form ?
> > > > > "i" is useless
> > > > >
> > > > > --
> > > > > Alex
> > > > >
> > > > > Roger <roger@web4sme.net> wrote in message
> > > > >news:9k8aoj$6su$1@news.codecharge.com...
> > > > > > > You may see this is in the BookStore example.
> > > > > > > When you search for books, you will see a message "Items
found:
> > 22"
> > > > > > > This is implemented in Books.asp page by adding "Open" event:
> > > > > > > sSQL="select count(item_id) as i_item_id from items as i"
> > > > > > >
> > > > > > > In many cases you can use your own SQL statement instead of
the
> > > table
> > > > by
> > > > > > > specifying it in Form properties.
> > > > > >
> > > > > > Could not get it to work.
> > > > > >
> > > > > > I am using PHP. So I use.
> > > > > > $sSQL="select count(id) as total_id from registration as i";
> > > > > >
> > > > > > Please explain total_id & i.
> > > > > > Alias?
> > > > > >
> > > > > > No errors but any extra hints why it cannot compute?
> > > > > > --
> > > > > > Rgds
> > > > > > Roger Tng
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

John
Posted: 08/04/2001, 10:24 AM

By specifying the table name "registration as i" it's using a shorthand to
refer to the table name. Also the statement gives the name total_id to the
result from count(id).

You need to be sure that the total_id is the name of the field with the id
in it. Check the code to see what is generated from the portion wit the
comment:
//-- retrieve data from the record

it should be something like this
$fldID = $db->f("i_total_ID");

If the generated code is different from the above $fldID value = ..... then
modify your $sSQL statement to suit.


"Roger" <roger@web4sme.net> wrote in message
news:9k8aoj$6su$1@news.codecharge.com...
> > You may see this is in the BookStore example.
> > When you search for books, you will see a message "Items found: 22"
> > This is implemented in Books.asp page by adding "Open" event:
> > sSQL="select count(item_id) as i_item_id from items as i"
> >
> > In many cases you can use your own SQL statement instead of the table by
> > specifying it in Form properties.
>
> Could not get it to work.
>
> I am using PHP. So I use.
> $sSQL="select count(id) as total_id from registration as i";
>
> Please explain total_id & i.
> Alias?
>
> No errors but any extra hints why it cannot compute?
> --
> Rgds
> Roger Tng
>
>
>

wm
Posted: 08/06/2001, 7:32 AM

Roger,
I was working on this this weekend and found a way that worked for me, I
hope it helps you.
I used the following code in the properties/events/open section of my total
field:
$sSQL="select count(PropertyID) as p_PropertyID from property as p";
Here is the explanation :
(PropertyID) is the primary Key of table propery.
p_PropertyID is the first letter of the table which in my case is "property"
underscore then the name of the Primary key.
property as p gives the table property the alias of "p" which is the first
letter of the table.

I didn't put anything in the properties/SQL section of the total field.

In properties/input of the total form I put the same inputs as the results
form(or what ever your form may be called).

In the total form in the fields section under field I used "PropertyID" as
the field(from the drop down menu) and put " Total records found: "under
Caption and "Label" under Type.

This is the same way the BookStore example does it but it took me some time
to figure out how to modify the code in the events to work with my database.
I hope my breaking it down helped.

And that's it. This worked great for me and showed the count of only those
records that were found.
If you have any questions let me know.
Thanks,
Walter


"Roger" <roger@web4sme.net> wrote in message
news:9kelq6$12p$1@news.codecharge.com...
> I will continue to do more testing.
> Meanwhile can you do all of us know what the COUNT SQL feature in the FORM
> properties is use d for?
>
> --
> Rgds
> Roger Tng
>
> "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
>news:9kdmci$n8$1@news.codecharge.com...
> > I don't know how to count your found total.
> > It's up to you to decide what condition to use.
> > Sorta select count (*) from table where some_condition
> > in your sql statement. It's sql level , not CC level.
> > If this depends on parameters then you can include them in the query
> > in "Where" box : where name=" & GetParam("name") & "
> >
> >
> > --
> > Alex
> > Ceritfied CodeCharge Developer
> > Develop database-connected web sites
> > without coding: http://www.codecharge.com
> > ASP, ASP.NET, PHP, JSP, Perl, ColdFusion
> >
> > Roger <roger@web4sme.net> wrote in message
> >news:9kcbd3$enk$1@news.codecharge.com...
> > > Tried moving to CustomSQL but it keeps giving the grand Total rather
> than
> > > the Found total.
> > > Used - Select Count(id) as total_id from registration. Filed list
> total_id
> > > selected.
> > >
> > > Give me some hints.
> > > --
> > > Rgds
> > > Roger Tng
> > > "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
> > >news:9kb5pc$kg$1@news.codecharge.com...
> > > > Please don't put in in sSQL when you can put it into Form
> > > > properties/SQL/Custom sql
> > > > and then you will definitely see "total" alias in the field list.
> > > >
> > > > --
> > > > Alex
> > > >
> > > > Roger <roger@web4sme.net> wrote in message
> > > >news:9k9jbb$t9b$1@news.codecharge.com...
> > > > > In my page, I have Search, Count(GRID) & List(GRID) forms.
> > > > > In my COUNT Form, I have ID in field list as LABEL. Total_id (I
> think
> > it
> > > > is
> > > > > an alias) is not one of my fields. So cannot select it.
> > > > > (I am following the BookStore sample (Books page) very closly.
> > > > > I put in $sSQL="select count(id) as total_id from registration";
> > > > >
> > > > > I notice the (BookStore sample) Form Properties has some
parameters
> in
> > > the
> > > > > Input page.
> > > > > I did not have any. Do I need to? I tried puting ID, and other
> fields
> > > but
> > > > > still the same - NO COUNT RESULT.
> > > > >
> > > > > --
> > > > > Rgds
> > > > > Roger Tng
> > > > >
> > > > > "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
> > > > >news:9k8qql$8nd$1@news.codecharge.com...
> > > > > > Did you select total_id from field list on a Form ?
> > > > > > "i" is useless
> > > > > >
> > > > > > --
> > > > > > Alex
> > > > > >
> > > > > > Roger <roger@web4sme.net> wrote in message
> > > > > >news:9k8aoj$6su$1@news.codecharge.com...
> > > > > > > > You may see this is in the BookStore example.
> > > > > > > > When you search for books, you will see a message "Items
> found:
> > > 22"
> > > > > > > > This is implemented in Books.asp page by adding "Open"
event:
> > > > > > > > sSQL="select count(item_id) as i_item_id from items as i"
> > > > > > > >
> > > > > > > > In many cases you can use your own SQL statement instead of
> the
> > > > table
> > > > > by
> > > > > > > > specifying it in Form properties.
> > > > > > >
> > > > > > > Could not get it to work.
> > > > > > >
> > > > > > > I am using PHP. So I use.
> > > > > > > $sSQL="select count(id) as total_id from registration as i";
> > > > > > >
> > > > > > > Please explain total_id & i.
> > > > > > > Alias?
> > > > > > >
> > > > > > > No errors but any extra hints why it cannot compute?
> > > > > > > --
> > > > > > > Rgds
> > > > > > > Roger Tng
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Roger
Posted: 08/06/2001, 12:25 PM

Walter,

I finally got the COUNT correct.
Thanks to your detailed explaination.
I just don't understand why it is not in CC document. I think it is a
feature many will need.
Just have to put in a week to get it done.
But then, it was fun picking up a few PHP/SQL knowledge along the way.
--
Rgds
Roger Tng
"wm" <beach4300@earthlink.net> wrote in message
news:9km9pm$7ho$1@news.codecharge.com...
> Roger,
> I was working on this this weekend and found a way that worked for me, I
> hope it helps you.
> I used the following code in the properties/events/open section of my
total
> field:
> $sSQL="select count(PropertyID) as p_PropertyID from property as p";
> Here is the explanation :
> (PropertyID) is the primary Key of table propery.
> p_PropertyID is the first letter of the table which in my case is
"property"
> underscore then the name of the Primary key.
> property as p gives the table property the alias of "p" which is the first
> letter of the table.
>
> I didn't put anything in the properties/SQL section of the total field.
>
> In properties/input of the total form I put the same inputs as the results
> form(or what ever your form may be called).
>
> In the total form in the fields section under field I used "PropertyID" as
> the field(from the drop down menu) and put " Total records found: "under
> Caption and "Label" under Type.
>
> This is the same way the BookStore example does it but it took me some
time
> to figure out how to modify the code in the events to work with my
database.
> I hope my breaking it down helped.
>
> And that's it. This worked great for me and showed the count of only
those
> records that were found.
> If you have any questions let me know.
> Thanks,
> Walter
>
>
> "Roger" <roger@web4sme.net> wrote in message
>news:9kelq6$12p$1@news.codecharge.com...
> > I will continue to do more testing.
> > Meanwhile can you do all of us know what the COUNT SQL feature in the
FORM
> > properties is use d for?
> >
> > --
> > Rgds
> > Roger Tng
> >
> > "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
> >news:9kdmci$n8$1@news.codecharge.com...
> > > I don't know how to count your found total.
> > > It's up to you to decide what condition to use.
> > > Sorta select count (*) from table where some_condition
> > > in your sql statement. It's sql level , not CC level.
> > > If this depends on parameters then you can include them in the query
> > > in "Where" box : where name=" & GetParam("name") & "
> > >
> > >
> > > --
> > > Alex
> > > Ceritfied CodeCharge Developer
> > > Develop database-connected web sites
> > > without coding: http://www.codecharge.com
> > > ASP, ASP.NET, PHP, JSP, Perl, ColdFusion
> > >
> > > Roger <roger@web4sme.net> wrote in message
> > >news:9kcbd3$enk$1@news.codecharge.com...
> > > > Tried moving to CustomSQL but it keeps giving the grand Total rather
> > than
> > > > the Found total.
> > > > Used - Select Count(id) as total_id from registration. Filed list
> > total_id
> > > > selected.
> > > >
> > > > Give me some hints.
> > > > --
> > > > Rgds
> > > > Roger Tng
> > > > "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
> > > >news:9kb5pc$kg$1@news.codecharge.com...
> > > > > Please don't put in in sSQL when you can put it into Form
> > > > > properties/SQL/Custom sql
> > > > > and then you will definitely see "total" alias in the field list.
> > > > >
> > > > > --
> > > > > Alex
> > > > >
> > > > > Roger <roger@web4sme.net> wrote in message
> > > > >news:9k9jbb$t9b$1@news.codecharge.com...
> > > > > > In my page, I have Search, Count(GRID) & List(GRID) forms.
> > > > > > In my COUNT Form, I have ID in field list as LABEL. Total_id (I
> > think
> > > it
> > > > > is
> > > > > > an alias) is not one of my fields. So cannot select it.
> > > > > > (I am following the BookStore sample (Books page) very closly.
> > > > > > I put in $sSQL="select count(id) as total_id from registration";
> > > > > >
> > > > > > I notice the (BookStore sample) Form Properties has some
> parameters
> > in
> > > > the
> > > > > > Input page.
> > > > > > I did not have any. Do I need to? I tried puting ID, and other
> > fields
> > > > but
> > > > > > still the same - NO COUNT RESULT.
> > > > > >
> > > > > > --
> > > > > > Rgds
> > > > > > Roger Tng
> > > > > >
> > > > > > "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
> > > > > >news:9k8qql$8nd$1@news.codecharge.com...
> > > > > > > Did you select total_id from field list on a Form ?
> > > > > > > "i" is useless
> > > > > > >
> > > > > > > --
> > > > > > > Alex
> > > > > > >
> > > > > > > Roger <roger@web4sme.net> wrote in message
> > > > > > >news:9k8aoj$6su$1@news.codecharge.com...
> > > > > > > > > You may see this is in the BookStore example.
> > > > > > > > > When you search for books, you will see a message "Items
> > found:
> > > > 22"
> > > > > > > > > This is implemented in Books.asp page by adding "Open"
> event:
> > > > > > > > > sSQL="select count(item_id) as i_item_id from items as
i"
> > > > > > > > >
> > > > > > > > > In many cases you can use your own SQL statement instead
of
> > the
> > > > > table
> > > > > > by
> > > > > > > > > specifying it in Form properties.
> > > > > > > >
> > > > > > > > Could not get it to work.
> > > > > > > >
> > > > > > > > I am using PHP. So I use.
> > > > > > > > $sSQL="select count(id) as total_id from registration as i";
> > > > > > > >
> > > > > > > > Please explain total_id & i.
> > > > > > > > Alias?
> > > > > > > >
> > > > > > > > No errors but any extra hints why it cannot compute?
> > > > > > > > --
> > > > > > > > Rgds
> > > > > > > > Roger Tng
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

wm
Posted: 08/06/2001, 1:49 PM

Roger,
I am glad to hear that it worked for you.
I wanted to let you know that the new 2.0 beta version of CC does have this
functionality built in. I allows you to have [1] of [125] for example. I
think this is a great improvement but I was too far along on my project to
change to the new version and so had to work with what was available for
1.1.14. You might want to look at the 2.0 beta. I have down loaded it but
also have 1.1.14 installed just incase(after all it is still a beta).
Thanks,
Walter

"Roger" <roger@web4sme.net> wrote in message
news:9kmqum$bl9$1@news.codecharge.com...
> Walter,
>
> I finally got the COUNT correct.
> Thanks to your detailed explaination.
> I just don't understand why it is not in CC document. I think it is a
> feature many will need.
> Just have to put in a week to get it done.
> But then, it was fun picking up a few PHP/SQL knowledge along the way.
> --
> Rgds
> Roger Tng
> "wm" <beach4300@earthlink.net> wrote in message
>news:9km9pm$7ho$1@news.codecharge.com...
> > Roger,
> > I was working on this this weekend and found a way that worked for me, I
> > hope it helps you.
> > I used the following code in the properties/events/open section of my
> total
> > field:
> > $sSQL="select count(PropertyID) as p_PropertyID from property as p";
> > Here is the explanation :
> > (PropertyID) is the primary Key of table propery.
> > p_PropertyID is the first letter of the table which in my case is
> "property"
> > underscore then the name of the Primary key.
> > property as p gives the table property the alias of "p" which is the
first
> > letter of the table.
> >
> > I didn't put anything in the properties/SQL section of the total field.
> >
> > In properties/input of the total form I put the same inputs as the
results
> > form(or what ever your form may be called).
> >
> > In the total form in the fields section under field I used "PropertyID"
as
> > the field(from the drop down menu) and put " Total records found: "under
> > Caption and "Label" under Type.
> >
> > This is the same way the BookStore example does it but it took me some
> time
> > to figure out how to modify the code in the events to work with my
> database.
> > I hope my breaking it down helped.
> >
> > And that's it. This worked great for me and showed the count of only
> those
> > records that were found.
> > If you have any questions let me know.
> > Thanks,
> > Walter
> >
> >
> > "Roger" <roger@web4sme.net> wrote in message
> >news:9kelq6$12p$1@news.codecharge.com...
> > > I will continue to do more testing.
> > > Meanwhile can you do all of us know what the COUNT SQL feature in the
> FORM
> > > properties is use d for?
> > >
> > > --
> > > Rgds
> > > Roger Tng
> > >
> > > "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
> > >news:9kdmci$n8$1@news.codecharge.com...
> > > > I don't know how to count your found total.
> > > > It's up to you to decide what condition to use.
> > > > Sorta select count (*) from table where some_condition
> > > > in your sql statement. It's sql level , not CC level.
> > > > If this depends on parameters then you can include them in the query
> > > > in "Where" box : where name=" & GetParam("name") & "
> > > >
> > > >
> > > > --
> > > > Alex
> > > > Ceritfied CodeCharge Developer
> > > > Develop database-connected web sites
> > > > without coding: http://www.codecharge.com
> > > > ASP, ASP.NET, PHP, JSP, Perl, ColdFusion
> > > >
> > > > Roger <roger@web4sme.net> wrote in message
> > > >news:9kcbd3$enk$1@news.codecharge.com...
> > > > > Tried moving to CustomSQL but it keeps giving the grand Total
rather
> > > than
> > > > > the Found total.
> > > > > Used - Select Count(id) as total_id from registration. Filed list
> > > total_id
> > > > > selected.
> > > > >
> > > > > Give me some hints.
> > > > > --
> > > > > Rgds
> > > > > Roger Tng
> > > > > "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
> > > > >news:9kb5pc$kg$1@news.codecharge.com...
> > > > > > Please don't put in in sSQL when you can put it into Form
> > > > > > properties/SQL/Custom sql
> > > > > > and then you will definitely see "total" alias in the field
list.
> > > > > >
> > > > > > --
> > > > > > Alex
> > > > > >
> > > > > > Roger <roger@web4sme.net> wrote in message
> > > > > >news:9k9jbb$t9b$1@news.codecharge.com...
> > > > > > > In my page, I have Search, Count(GRID) & List(GRID) forms.
> > > > > > > In my COUNT Form, I have ID in field list as LABEL. Total_id
(I
> > > think
> > > > it
> > > > > > is
> > > > > > > an alias) is not one of my fields. So cannot select it.
> > > > > > > (I am following the BookStore sample (Books page) very closly.
> > > > > > > I put in $sSQL="select count(id) as total_id from
registration";
> > > > > > >
> > > > > > > I notice the (BookStore sample) Form Properties has some
> > parameters
> > > in
> > > > > the
> > > > > > > Input page.
> > > > > > > I did not have any. Do I need to? I tried puting ID, and other
> > > fields
> > > > > but
> > > > > > > still the same - NO COUNT RESULT.
> > > > > > >
> > > > > > > --
> > > > > > > Rgds
> > > > > > > Roger Tng
> > > > > > >
> > > > > > > "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
> > > > > > >news:9k8qql$8nd$1@news.codecharge.com...
> > > > > > > > Did you select total_id from field list on a Form ?
> > > > > > > > "i" is useless
> > > > > > > >
> > > > > > > > --
> > > > > > > > Alex
> > > > > > > >
> > > > > > > > Roger <roger@web4sme.net> wrote in message
> > > > > > > >news:9k8aoj$6su$1@news.codecharge.com...
> > > > > > > > > > You may see this is in the BookStore example.
> > > > > > > > > > When you search for books, you will see a message "Items
> > > found:
> > > > > 22"
> > > > > > > > > > This is implemented in Books.asp page by adding "Open"
> > event:
> > > > > > > > > > sSQL="select count(item_id) as i_item_id from items as
> i"
> > > > > > > > > >
> > > > > > > > > > In many cases you can use your own SQL statement instead
> of
> > > the
> > > > > > table
> > > > > > > by
> > > > > > > > > > specifying it in Form properties.
> > > > > > > > >
> > > > > > > > > Could not get it to work.
> > > > > > > > >
> > > > > > > > > I am using PHP. So I use.
> > > > > > > > > $sSQL="select count(id) as total_id from registration as
i";
> > > > > > > > >
> > > > > > > > > Please explain total_id & i.
> > > > > > > > > Alias?
> > > > > > > > >
> > > > > > > > > No errors but any extra hints why it cannot compute?
> > > > > > > > > --
> > > > > > > > > Rgds
> > > > > > > > > Roger Tng
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Roger
Posted: 08/07/2001, 10:12 AM

Walter,
I am using v2.
I notice it has Page nn of nn in the Properties of the Search Result GRID.
Do not see 1 of 125. Where should I look?

--
Rgds
Roger Tng

"wm" <beach4300@earthlink.net> wrote in message
news:9kmvth$lm5$1@news.codecharge.com...
> Roger,
> I am glad to hear that it worked for you.
> I wanted to let you know that the new 2.0 beta version of CC does have
this
> functionality built in. I allows you to have [1] of [125] for example. I
> think this is a great improvement but I was too far along on my project to
> change to the new version and so had to work with what was available for
> 1.1.14. You might want to look at the 2.0 beta. I have down loaded it
but
> also have 1.1.14 installed just incase(after all it is still a beta).
> Thanks,
> Walter
>
> "Roger" <roger@web4sme.net> wrote in message
>news:9kmqum$bl9$1@news.codecharge.com...
> > Walter,
> >
> > I finally got the COUNT correct.
> > Thanks to your detailed explaination.
> > I just don't understand why it is not in CC document. I think it is a
> > feature many will need.
> > Just have to put in a week to get it done.
> > But then, it was fun picking up a few PHP/SQL knowledge along the way.
> > --
> > Rgds
> > Roger Tng
> > "wm" <beach4300@earthlink.net> wrote in message
> >news:9km9pm$7ho$1@news.codecharge.com...
> > > Roger,
> > > I was working on this this weekend and found a way that worked for me,
I
> > > hope it helps you.
> > > I used the following code in the properties/events/open section of my
> > total
> > > field:
> > > $sSQL="select count(PropertyID) as p_PropertyID from property as p";
> > > Here is the explanation :
> > > (PropertyID) is the primary Key of table propery.
> > > p_PropertyID is the first letter of the table which in my case is
> > "property"
> > > underscore then the name of the Primary key.
> > > property as p gives the table property the alias of "p" which is the
> first
> > > letter of the table.
> > >
> > > I didn't put anything in the properties/SQL section of the total
field.
> > >
> > > In properties/input of the total form I put the same inputs as the
> results
> > > form(or what ever your form may be called).
> > >
> > > In the total form in the fields section under field I used
"PropertyID"
> as
> > > the field(from the drop down menu) and put " Total records found:
"under
> > > Caption and "Label" under Type.
> > >
> > > This is the same way the BookStore example does it but it took me some
> > time
> > > to figure out how to modify the code in the events to work with my
> > database.
> > > I hope my breaking it down helped.
> > >
> > > And that's it. This worked great for me and showed the count of only
> > those
> > > records that were found.
> > > If you have any questions let me know.
> > > Thanks,
> > > Walter
> > >
> > >
> > > "Roger" <roger@web4sme.net> wrote in message
> > >news:9kelq6$12p$1@news.codecharge.com...
> > > > I will continue to do more testing.
> > > > Meanwhile can you do all of us know what the COUNT SQL feature in
the
> > FORM
> > > > properties is use d for?
> > > >
> > > > --
> > > > Rgds
> > > > Roger Tng
> > > >
> > > > "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
> > > >news:9kdmci$n8$1@news.codecharge.com...
> > > > > I don't know how to count your found total.
> > > > > It's up to you to decide what condition to use.
> > > > > Sorta select count (*) from table where some_condition
> > > > > in your sql statement. It's sql level , not CC level.
> > > > > If this depends on parameters then you can include them in the
query
> > > > > in "Where" box : where name=" & GetParam("name") & "
> > > > >
> > > > >
> > > > > --
> > > > > Alex
> > > > > Ceritfied CodeCharge Developer
> > > > > Develop database-connected web sites
> > > > > without coding: http://www.codecharge.com
> > > > > ASP, ASP.NET, PHP, JSP, Perl, ColdFusion
> > > > >
> > > > > Roger <roger@web4sme.net> wrote in message
> > > > >news:9kcbd3$enk$1@news.codecharge.com...
> > > > > > Tried moving to CustomSQL but it keeps giving the grand Total
> rather
> > > > than
> > > > > > the Found total.
> > > > > > Used - Select Count(id) as total_id from registration. Filed
list
> > > > total_id
> > > > > > selected.
> > > > > >
> > > > > > Give me some hints.
> > > > > > --
> > > > > > Rgds
> > > > > > Roger Tng
> > > > > > "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
> > > > > >news:9kb5pc$kg$1@news.codecharge.com...
> > > > > > > Please don't put in in sSQL when you can put it into Form
> > > > > > > properties/SQL/Custom sql
> > > > > > > and then you will definitely see "total" alias in the field
> list.
> > > > > > >
> > > > > > > --
> > > > > > > Alex
> > > > > > >
> > > > > > > Roger <roger@web4sme.net> wrote in message
> > > > > > >news:9k9jbb$t9b$1@news.codecharge.com...
> > > > > > > > In my page, I have Search, Count(GRID) & List(GRID) forms.
> > > > > > > > In my COUNT Form, I have ID in field list as LABEL. Total_id
> (I
> > > > think
> > > > > it
> > > > > > > is
> > > > > > > > an alias) is not one of my fields. So cannot select it.
> > > > > > > > (I am following the BookStore sample (Books page) very
closly.
> > > > > > > > I put in $sSQL="select count(id) as total_id from
> registration";
> > > > > > > >
> > > > > > > > I notice the (BookStore sample) Form Properties has some
> > > parameters
> > > > in
> > > > > > the
> > > > > > > > Input page.
> > > > > > > > I did not have any. Do I need to? I tried puting ID, and
other
> > > > fields
> > > > > > but
> > > > > > > > still the same - NO COUNT RESULT.
> > > > > > > >
> > > > > > > > --
> > > > > > > > Rgds
> > > > > > > > Roger Tng
> > > > > > > >
> > > > > > > > "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
> > > > > > > >news:9k8qql$8nd$1@news.codecharge.com...
> > > > > > > > > Did you select total_id from field list on a Form ?
> > > > > > > > > "i" is useless
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Alex
> > > > > > > > >
> > > > > > > > > Roger <roger@web4sme.net> wrote in message
> > > > > > > > >news:9k8aoj$6su$1@news.codecharge.com...
> > > > > > > > > > > You may see this is in the BookStore example.
> > > > > > > > > > > When you search for books, you will see a message
"Items
> > > > found:
> > > > > > 22"
> > > > > > > > > > > This is implemented in Books.asp page by adding "Open"
> > > event:
> > > > > > > > > > > sSQL="select count(item_id) as i_item_id from items
as
> > i"
> > > > > > > > > > >
> > > > > > > > > > > In many cases you can use your own SQL statement
instead
> > of
> > > > the
> > > > > > > table
> > > > > > > > by
> > > > > > > > > > > specifying it in Form properties.
> > > > > > > > > >
> > > > > > > > > > Could not get it to work.
> > > > > > > > > >
> > > > > > > > > > I am using PHP. So I use.
> > > > > > > > > > $sSQL="select count(id) as total_id from registration as
> i";
> > > > > > > > > >
> > > > > > > > > > Please explain total_id & i.
> > > > > > > > > > Alias?
> > > > > > > > > >
> > > > > > > > > > No errors but any extra hints why it cannot compute?
> > > > > > > > > > --
> > > > > > > > > > Rgds
> > > > > > > > > > Roger Tng
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


   


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.