Re: Column Totals

From: Date: Mon, 15 Nov 2004 18:24:05 +0000
Subject: Re: Column Totals
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-202064@lists.php.net to get a copy of this message
Ben Miller wrote:
I am trying to get the total sales revenue for each day of the month, and having no luck at all. <snipped/>
In case it helps, sample table data might look like this:
OrderNo        OrderDate        Revenue
1111               1                      79.95
1112               1                      39.95
1113               3                      89.95
I would guess that you have a char type for your Revenue Column which would lead to this situation. If you are unsure about which data type to use you will have to ask in a mysql mailing list. you might also want to echo out your query and run it directly in the mysql client to see what happens. Liberal user of error_log(mysql_error()) in your code would probably help too.
-- Raditha Dissanayake. ------------------------------------------------------------------ http://www.radinks.com/print/card-designer/ | Card Designer Applet http://www.radinks.com/upload/ | Drag and Drop Upload

« previous php.general (#202064) next »