On Wed, January 30, 2008 12:58 am, Dax Solomon Umaming wrote:
> Hi;
>
> I've tried Googling this out but failed to search for an answer to
> this, so
> I'm posting to this list. I'd like to know if there's a way to get the
> sum
> this results:
>
> // Results
> Individual Daily Consumption
> //Ac
On Jan 30, 2008 1:58 AM, Dax Solomon Umaming <[EMAIL PROTECTED]> wrote:
> I've tried Googling this out but failed to search for an answer to this, so
> I'm posting to this list. I'd like to know if there's a way to get the sum
> this results:
you can simply sum them as you print the report
$sum =
Hi;
I've tried Googling this out but failed to search for an answer to this, so
I'm posting to this list. I'd like to know if there's a way to get the sum
this results:
// Results
Individual Daily Consumption
//AccountNo : Consumption
4146121002: 1.42
4146111002: 0.29
4146113002: 1.38
414611000
[snip]
Sorry, Jay, but that's a horrible method. You could just run one query
with
a GROUP BY clause to get the sum for each invoiceID, instead of running
multiple queries like you've mentioned...
$query = "SELECT invoiceid, SUM(partpaidamount) AS partpaid FROM
$tb_name
GROUP BY invoiceid";
$rs =
I am trying to sum a query of values from a MySQL table. The code I am
using is:
---BEGIN CODE #1--
$sql_2 = "SELECT SUM(partpaidamount) as partpaid
FROM $tb_name
WHERE invoiceid = \"$invoiceid\"
";
$result_2 = @mysql_query($sql_2,$connection) or die(mysql_err
PROTECTED]
Subject: [PHP] Sum a column of values from a MySQL query
I am trying to sum a query of values from a MySQL table. The code I am
using is:
---BEGIN CODE #1--
$sql_2 = "SELECT SUM(partpaidamount) as partpaid
FROM $tb_name
WHERE invoiceid
From bitter experience I'll suggest that it's a REALLY GOOD idea to store
invoice totals, subtotals, etc. in either the invoice header record. If not
rounding errors, or some small change in logic, can come back and bite you
- accountants get *really* upset when that 3000.00 invoice becomes 3000
[snip]
1) The code returns the sum of a partially paid invoice. The individual
invoice is 'partpaid'. WORKS...NO PROBLEM
2) The while() then return a list of partially paid invoices which is
$invoicepartpaid. WORKS..NO PROBLEM
3) I then want to add the list of partially paid invoices
($invoicepar
Message -
From: "Jay Blanchard" <[EMAIL PROTECTED]>
To: "Ben C." <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, August 05, 2003 8:29 AM
Subject: RE: [PHP] Sum a column of values from a MySQL query
[snip]
1) The code returns the sum of a partiall
Quoting "Ben C." <[EMAIL PROTECTED]>:
> I am trying to sum a query of values from a MySQL table. The code I am
> using is:
>
> ---BEGIN CODE #1--
> $sql_2 = "SELECT SUM(partpaidamount) as partpaid
> FROM $tb_name
> WHERE invoiceid = \"$invoiceid\"
> ";
>
> $result_
I am trying to sum a query of values from a MySQL table. The code I am
using is:
---BEGIN CODE #1--
$sql_2 = "SELECT SUM(partpaidamount) as partpaid
FROM $tb_name
WHERE invoiceid = \"$invoiceid\"
";
$result_2 = @mysql_query($sql_2,$connection) or die(mysql_err
> -Original Message-
> From: Ben C. [mailto:[EMAIL PROTECTED]
> Sent: 05 August 2003 07:42
>
> I am trying to sum a query of values from a MySQL table. The
> code I am
> using is:
>
> ---BEGIN CODE #1--
> $sql_2 = "SELECT SUM(partpaidamount) as partpaid
> FROM $tb_name
[snip]
However, why not just SUM all the rows in the table in the query if you
just
want a total?
$sql_2 = "SELECT SUM(partpaidamount) as partpaid FROM $tb_name";
[/snip]
That is what he is doing. The SELECT SUM will only return ONE row! I am
not sure that the problem is being explained clearly t
On Tuesday 05 August 2003 15:43, Ben C. wrote:
> Yes, I know. However, the while() loop should generate all the invoice in
> a list.
As has been pointed out the query only results in a single row. So how would
the while-loop "generate all the invoice[s]"? It's only ever given a single
row to pl
Yes, I know. However, the while() loop should generate all the invoice in a
list.
-Original Message-
From: Giz [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 05, 2003 12:03 AM
To: 'Ben C.'; [EMAIL PROTECTED]
Subject: RE: [PHP] Sum a column of values from a MySQL query
I thin
On Mon, May 06, 2002 at 10:01:00AM -0700, Fifield, Mike wrote:
> amounts stored "float" values. But what I get back it something like this
> "98.18855591" it is to precise. All I want is the dolor amounts added up
> and rounded up to the closest penny. Is there a better value type to use or
I am using the mysql sum() function to return the "sum" of a bunch of dolor
amounts stored "float" values. But what I get back it something like this
"98.18855591" it is to precise. All I want is the dolor amounts added up
and rounded up to the closest penny. Is there a better value type to u
On Mon, 19 Feb 2001 06:57, Claudia wrote:
> I am looking for code that explains how to sum a value in a database
> based on a current field retrieved from the database.
>
> Example:
>
> query = "select course_name, course_build, milestone, testcase,
> time_tested, issue_status, comment,
>bug_n
I am looking for code that explains how to sum a value in a database based
on a current field retrieved from the database.
Example:
query = "select course_name, course_build, milestone, testcase, time_tested,
issue_status, comment,
bug_number, tested_by, date_tested from testissues where tes
.
> > - Shane
> >
> > - Original Message -----
> > From: "Keith Whyman" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, February 07, 2001 12:15 PM
> > Subject: [PHP] Sum from Arrays ?
> >
>
s well-versed in this, or any other, topic
> > - Shane
> >
> > - Original Message -----
> > From: "Keith Whyman" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, February 07, 2001 12:15 PM
> > Sub
m: "Keith Whyman" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, February 07, 2001 12:15 PM
> Subject: [PHP] Sum from Arrays ?
>
>
> > It's probably a stupid question but...
> > I've got the following ;
&g
..
- Shane
- Original Message -
From: "Keith Whyman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 07, 2001 12:15 PM
Subject: [PHP] Sum from Arrays ?
> It's probably a stupid question but...
> I've got the followin
It's probably a stupid question but...
I've got the following ;
SELECT t_category_name COUNT(*) AS count
FROM t_city,t_zipcodecity,t_location,t_category , t_locationcategory
WHERE (t_category_id_category = t_locationcategory_id_category)
AND (t_location_id_location = t_locationcategory_id
24 matches
Mail list logo