SQL sum question

2007-05-18 Thread Gareth Hughes
I have a db table that stores basic historical page view data. Each day a task runs and inserts the date, a record of the pages viewed and a count of how many times each was viewed. It's easy to select the most viewed pages for a given date using: select pname,pagehit from tbl_log_page_count

Re: SQL sum question

2007-05-18 Thread Gareth Hughes
I really should have been able to figure that out. Hopefully I'll remember next time :) Many thanks Jochem. - Original Message - From: Jochem van Dieten [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Friday, May 18, 2007 12:36 PM Subject: Re: SQL sum question Gareth

Re: SQL sum question

2007-05-18 Thread Jochem van Dieten
Gareth Hughes wrote: select pname,sum(pagehit) as pagehit where dates between x and y group by pname, pagehit order by pagehit desc, pname select pname,sum(pagehit) as pageHitCumul where dates between x and y group by pname order by sum(pagehit) desc, pname Jochem

Re: Quick SQL Sum Question

2003-08-14 Thread Alan Ford
To use SUM( ) the column in question MUST be numeric type (int, decimal, float etc). It doesn't have to be - this works (as long as all the rows can be cast) - select sum (cast(Value as decimal)) as val Regards, Alan Ford

Quick SQL Sum Question

2003-08-14 Thread webmaster
How can I easily nab the SUM of the inventory.service_shipping records returned in this query via SQL? SUM blah AS cblah tosses an error, I suppose because just one part is aggregate? Any quick ideas? cfquery name=get_productHOLDS datasource=sddheinz SELECT

RE: Quick SQL Sum Question

2003-08-14 Thread Mark A. Kruger - CFG
- From: Andrew Golden [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 8:27 AM To: CF-Talk Subject: Re: Quick SQL Sum Question At 03:27 PM 8/12/2003 -0500, you wrote: How can I easily nab the SUM of the inventory.service_shipping records returned in this query via SQL? SUM blah

RE: Quick SQL Sum Question

2003-08-14 Thread Mark A. Kruger - CFG
SQL Sum Question To use SUM( ) the column in question MUST be numeric type (int, decimal, float etc). It doesn't have to be - this works (as long as all the rows can be cast) - select sum (cast(Value as decimal)) as val Regards, Alan Ford

Re: Quick SQL Sum Question

2003-08-14 Thread Andrew Golden
At 03:27 PM 8/12/2003 -0500, you wrote: How can I easily nab the SUM of the inventory.service_shipping records returned in this query via SQL? SUM blah AS cblah tosses an error, I suppose because just one part is aggregate? Any quick ideas? Have you tried SUM(blah) AS cblah? Sometimes odd

RE: Quick SQL Sum Question

2003-08-14 Thread Mark A. Kruger - CFG
Can you post your attempt at using SUM( )? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 2:06 PM To: CF-Talk Subject: RE: Quick SQL Sum Question I need the sum...I am trying to get the total of additional shipping from the products

RE: Quick SQL Sum Question

2003-08-14 Thread webmaster
-Original Message- From: Andrew Golden [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 8:27 AM To: CF-Talk Subject: Re: Quick SQL Sum Question At 03:27 PM 8/12/2003 -0500, you wrote: How can I easily nab the SUM of the inventory.service_shipping records returned in this query via

RE: SQL SUM Question

2001-01-04 Thread bflynn
al Message- From: Kevin Queen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 03, 2001 4:36 PM To: CF-Talk Subject: SQL SUM Question List, If I run the following query: Select Number from Tbl_Numbers SUM(Number) how can I oputput the SUMed variable in a cfoutput? TIA, K

SQL SUM Question

2001-01-03 Thread Kevin Queen
List, If I run the following query: Select Number from Tbl_Numbers SUM(Number) how can I oputput the SUMed variable in a cfoutput? TIA, Kevin Queen ~~ Structure your ColdFusion code with Fusebox. Get the official book at

RE: SQL SUM Question

2001-01-03 Thread Kurt Ward
Select Number from Tbl_Numbers SUM(Number) AS MyVar cfoutput#MyVar#/Cfoutput -Original Message- From: Kevin Queen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 03, 2001 4:36 PM To: CF-Talk Subject: SQL SUM Question List, If I run the following query: Select Number from

Re: SQL SUM Question

2001-01-03 Thread Ricq Pattay
AIL PROTECTED] Sent: Wednesday, January 03, 2001 3:36 PM Subject: SQL SUM Question List, If I run the following query: Select Number from Tbl_Numbers SUM(Number) how can I oputput the SUMed variable in a cfoutput? TIA, Kevin Queen ~~ Structure you

RE: SQL SUM Question

2001-01-03 Thread LKHaas
You have to select it as something, for example: select sum(number) as sum_number from Tbl_Numbers Regards, Lisa Haas The Kennedy Center -Original Message- From: Kevin Queen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 03, 2001 4:36 PM To: CF-Talk Subject: SQL SUM Question

RE: SQL SUM Question

2001-01-03 Thread Joshua Tipton
select number sum(number) from tbl_numbers cfoutput query #number# I think that is right I would try it -Original Message- From: Kevin Queen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 03, 2001 4:36 PM To: CF-Talk Subject: SQL SUM Question List, If I run

RE: SQL SUM Question

2001-01-03 Thread Joshua Tipton
Thats right I gorgot the as -Original Message- From: Kurt Ward [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 03, 2001 4:40 PM To: CF-Talk Subject: RE: SQL SUM Question Select Number from Tbl_Numbers SUM(Number) AS MyVar cfoutput#MyVar#/Cfoutput -Original Message