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 -> CodeCharge.Discussion

 Making some calculation

Print topic Send  topic

Author Message
Phillips
Posted: 05/15/2002, 9:26 AM

Hi,

I'm trying to make some calculation in the result of return records. I
wanted to get a percentage of the result compare to the total records
(total_record/result_return). I got the total record and the number of the
result display (from bookstore example), but don't know how to implement the
division part.

recs = cn.execute ("select count(*) from IDR").fields.item(0)
response.write "Total records:" & recs

test =cn.execute("select count(tIDRCasenumber) as i_tIDRcasenumber from IDR
as i")

Help:(

Alexey Alexapolsky
Posted: 05/16/2002, 3:03 AM

This will take some string operations.
Now that you know total record count you need to find out how many records
were found. You should sSQL variable , it contains sql statement to be
executed
to locate this records. You need to turn it into a count sql statement by
replacing
field list in the statement (substring between SELECT and FROM words) with
COUNT(*)
save new sql statement to new variable and get the result like this

total_returned = cn.execute(new_sql).fields.item(0)

--
Alex
CodeCharge Developer


"Phillips" <fdiskboy@msn.com> wrote in message
news:abu27b$mnt$1@news.codecharge.com...
> Hi,
>
> I'm trying to make some calculation in the result of return records. I
> wanted to get a percentage of the result compare to the total records
> (total_record/result_return). I got the total record and the number of
the
> result display (from bookstore example), but don't know how to implement
the
> division part.
>
> recs = cn.execute ("select count(*) from IDR").fields.item(0)
> response.write "Total records:" & recs
>
> test =cn.execute("select count(tIDRCasenumber) as i_tIDRcasenumber from
IDR
> as i")
>
> Help:(
>
>

Phillips
Posted: 05/16/2002, 8:16 AM

Thank you Alex for you reply. I'm totally clueless when come to coding in
SQL, would you please help?

Thanks
"Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
news:ac0069$794$2@news.codecharge.com...
> This will take some string operations.
> Now that you know total record count you need to find out how many records
> were found. You should sSQL variable , it contains sql statement to be
> executed
> to locate this records. You need to turn it into a count sql statement by
> replacing
> field list in the statement (substring between SELECT and FROM words) with
> COUNT(*)
> save new sql statement to new variable and get the result like this
>
> total_returned = cn.execute(new_sql).fields.item(0)
>
> --
> Alex
> CodeCharge Developer
>
>
> "Phillips" <fdiskboy@msn.com> wrote in message
>news:abu27b$mnt$1@news.codecharge.com...
> > Hi,
> >
> > I'm trying to make some calculation in the result of return records. I
> > wanted to get a percentage of the result compare to the total records
> > (total_record/result_return). I got the total record and the number of
> the
> > result display (from bookstore example), but don't know how to implement
> the
> > division part.
> >
> > recs = cn.execute ("select count(*) from IDR").fields.item(0)
> > response.write "Total records:" & recs
> >
> > test =cn.execute("select count(tIDRCasenumber) as i_tIDRcasenumber from
> IDR
> > as i")
> >
> > Help:(
> >
> >
>
>


   


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.