Re: How to summarize weekly totals?

2006-10-28 Thread Peter Brawley
>Some days may be missing if it is a holiday, which means I can't >guarantee each week will have a sales row for Monday or Saturday. >Do I need to write a program to do this? Or can it be done with SQL? TIA Group by WEEK(sale_date), or build a calendar table and join from it. PB mos wrot

How to summarize weekly totals?

2006-10-27 Thread mos
I can't get my head around this, but I think I should be able to do it using just SQL without writing a program. I have a simple table that looks like: Rcd_Id: Integer; Sale_Date: Date; Sale_Amt: Double; Each date will have 1 row with the total sales for that day. and I want to sum the weekly

Re: How to summarize a table?

2005-06-19 Thread Juan Pedro Reyes Molina
e the value of just one row of every Cod_P in log table. this way it works update `master` set Total = (select sum(Import) from `log` where `master`.Cod_P=`log`.Cod_P) but I get 1 warning (I don't know what warning) and I deem this way inefficient in case I have to summarize several col

Re: How to summarize a table?

2005-06-18 Thread mfatene
om ( select sum(Import) TotalImport, log.Cod_P > >> from master inner join log > >> on (master.Cod_P=log.Cod_P) > >> group by log.Cod_P) t > >>where master.Cod_P = t.Cod_P > >> > >>which, IMHO, is a clean way to do this. > >

Re: How to summarize a table?

2005-06-18 Thread Juan Pedro Reyes Molina
is way it works update `master` set Total = (select sum(Import) from `log` where `master`.Cod_P=`log`.Cod_P) but I get 1 warning (I don't know what warning) and I deem this way inefficient in case I have to summarize several columns. I would need to write update `master` set Total = (sel

Re: How to summarize a table?

2005-06-18 Thread mfatene
n log table. > > this way it works > > update `master` > set Total = (select sum(Import) from `log` where > `master`.Cod_P=`log`.Cod_P) > > but I get 1 warning (I don't know what warning) and I deem this way > inefficient in case I have to summarize severa

How to summarize a table?

2005-06-18 Thread Juan Pedro Reyes Molina
and I deem this way inefficient in case I have to summarize several columns. I would need to write update `master` set Total = (select sum(Import) from `log` where `master`.Cod_P=`log`.Cod_P), set Total1 = (select sum(Import1) from `log` where `master`.Cod_P=`log`.Cod_P), set Total2 =

Re: Summarize

2002-03-05 Thread Anvar Hussain K.M.
Hi, Select Sum(ifnull(column1,0)+ifnull(column2,0)+ ...+ifnull(columnn,0)) From tbl group by .. Anvar. At 11:34 PM 05/03/2002 +0100, you wrote: >Dear, > >I am stuck on something, >I would like to summarize multiple columns to a total value in a query and >then display the out

Re: Summarize

2002-03-05 Thread DL Neil
Dear Alainq, > I am stuck on something, > I would like to summarize multiple columns to a total value in a query and > then display the output with php in a table. > the summarize works for 1 column but not for two or more. > any suggestions >? So is what you are doing some

Re: Summarize

2002-03-05 Thread Nathan
e. Cheers, # Nathan - Original Message - From: "Alainq" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 05, 2002 3:34 PM Subject: Summarize Dear, I am stuck on something, I would like to summarize multiple columns to a total value in a query and the

Summarize

2002-03-05 Thread Alainq
Dear, I am stuck on something, I would like to summarize multiple columns to a total value in a query and then display the output with php in a table. the summarize works for 1 column but not for two or more. any suggestions >? Thanks a