Sorry : my mistake, I was mistaking this thread for "Is there a
non-aggregate Max() function in MySQL?"
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doublecli
>>you can also do:
#arraysum(queryname.columnname)#
Any CF function will be executed before the query by CF.
What is needed here is an SQL function executed inside the query.
~|
Adobe® ColdFusion® 8 software 8 is the most import
you can also do:
#arraysum(queryname.columnname)#
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Tech Gate wrote:
>
> select a.Dept, c.Assonum
> .
> group by a.Dept, c.Assonum
>
>
> I need to get the SUM of c.Assonum, but I can't do sum(c.Assonum ) in
> the sql (cfquer
Yup. I got it.
Thanks so much
On Fri, Dec 12, 2008 at 8:19 PM, Jason Fisher wrote:
> There's not a function, but you can add them up as you loop over the query:
>
>
>
>
>
> SUM of Assonum is #sumAssonum#
>
>>
>> select a.Dept, c.Assonum
>> .
>> group by a.Dept, c.Assonum
>>
>>
>
There's not a function, but you can add them up as you loop over the query:
SUM of Assonum is #sumAssonum#
>
> select a.Dept, c.Assonum
> .
> group by a.Dept, c.Assonum
>
>
> I need to get the SUM of c.Assonum, but I can't do sum(c.Assonum ) in
> the sql (cfquery).
> What is the
mssql2000
On Jan 1, 2008 3:07 PM, Greg Morphis <[EMAIL PROTECTED]> wrote:
> You may have to use the QoQ.. if you bring the count up into the outer
> query you'll have to use GROUP BY defeating the sum() (unless you're
> using Oracle in which you can do a sum over. What RDBMS are you using?
>
>
>
You may have to use the QoQ.. if you bring the count up into the outer
query you'll have to use GROUP BY defeating the sum() (unless you're
using Oracle in which you can do a sum over. What RDBMS are you using?
On Jan 1, 2008 1:47 PM, morchella <[EMAIL PROTECTED]> wrote:
> thats what i just said.
thats what i just said.
i can now get #get_totals.Sumtotal#
but not #get_totals.total#
where befor i could get either using a qoq.
Select SUM(total) AS Sumtotal
>From (
Select Count(*) AS total
From employees
WHERE emp_assigned = #get_Emp.usr_id#
) AS derived_table
On Jan 1, 200
use
query.sumtotal
On Jan 1, 2008 1:16 PM, morchella <[EMAIL PROTECTED]> wrote:
> ok..
> i did this
>
>
> Select SUM(total) AS Sumtotal
> From (
>Select Count(*) AS total
>From employees
>WHERE emp_assigned = #get_Emp.usr_id#
>) AS derived_table
>
>
> but now i cant call the vari
ok..
i did this
Select SUM(total) AS Sumtotal
>From (
Select Count(*) AS total
From employees
WHERE emp_assigned = #get_Emp.usr_id#
) AS derived_table
but now i cant call the variable total to show with in my page?
it shows Sumtotal just fine..
i have tried
get_totals.derived_t
OK...
very cool.
i am not familiar with sub queries.
will have to google.
On Jan 1, 2008 1:32 PM, Greg Morphis <[EMAIL PROTECTED]> wrote:
> use a subquery..
>
> select sum(foo) as daSum
> from
> (
> select count(goo) as foo
> from table
> where hoo = 1
> )
>
>
>
> On Jan 1, 2008 12:14 PM, Pau
use a subquery..
select sum(foo) as daSum
from
(
select count(goo) as foo
from table
where hoo = 1
)
On Jan 1, 2008 12:14 PM, Paul Ihrig <[EMAIL PROTECTED]> wrote:
> yeah
> i was trying to sum on the result of the count
> if i do this i only get the last result, not the sum of all
>
>
>
nm
just had to nest
honestly i already have all every thing i need dont inside of a nested loop.
but some one said doing it with q0q inside nested ouptuts would put less
strain on the server.
Is this true?
~|
Adobe® ColdFus
yeah
i was trying to sum on the result of the count
if i do this i only get the last result, not the sum of all
Select Count(*) AS total
From employees
WHERE emp_assigned = #get_Emp.usr_id#
Select SUM(total) AS Sumtotal
From employees
name value
p1 25
p2 30
p3
specify the column name that you're trying to SUM
On Jan 1, 2008 9:55 AM, morchella <[EMAIL PROTECTED]> wrote:
> ok not sure what i am doing wrong
> in my out put it does the count just fine, but i cant get it to SUM up the
> totals.
>
> error:
> [Macromedia][SQLServer JDBC Driver][SQLServer]Incor
list.
M!ke
-Original Message-
From: Roberto Perez [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 20, 2006 8:20 AM
To: CF-Talk
Subject: Re: SUM within general QUERY
At 09:04 AM 8/20/2006, Jochem van Dieten wrote:
>SELECT
> a.accountID,
> a.accountName,
> a.accountDeb
You need a GROUP BY clause. Any columns, in the SELECT list, on which
you don't perform a function, must be added to the GROUP BY list.
SELECT
a.accountID, a.accountName, a.accountDebits,
SUM(a.accountDebits) AS TotalSpent
FROM account_tb a
WHERE a.accountID = 22
GROUP BY a.accountID, a.accou
At 09:04 AM 8/20/2006, Jochem van Dieten wrote:
>SELECT
> a.accountID,
> a.accountName,
> a.accountDebits,
> SUM(a.accountDebits) AS TotalSpent
>FROM
> account_tb a
>WHERE
> a.accountID = 22
>GROUP BY
> a.accountID,
> a.accountName,
> a.accountDebits
Thank you for a prompt
Roberto Perez wrote:
>
> SELECT
> a.accountID, a.accountName, a.accountDebits,
> SUM(a.accountDebits) AS TotalSpent
> FROM account_tb a
> WHERE a.accountID = 22
>
> ...but CF tells me: "You tried to execute a query that does not
> include the specified expression 'accountID' as part of an
That was it! Thanks for all help Pascal!!
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
The problem is you cant do it in one query, because of the grouping and
selecting too much data. If you need the total time (or time per
client), you will probably need two queries. The problem is that I have
no idea which column belongs to which table.
Get all the records you need
SELECT tcd.C
>Some of us can't read every mail message that comes through the system.
>This was a pun to get you to mail your message again.
>
>Mail the message again and I promise I will try and help!
Sorry, I'm reading this through the Web site and not email. I'll post teh problem again.
[Todays Threads]
Some of us can't read every mail message that comes through the system.
This was a pun to get you to mail your message again.
Mail the message again and I promise I will try and help!
hammerin hankster wrote:
> >And Grind?
>
> Cute...thanks for the help.
[Todays Threads]
[This Message]
[
>And Grind?
Cute...thanks for the help.
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
And Grind?
> bump
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
bump
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
>Q was just an example (as I didn't know the name of your query). Use the
>name of your query (esitest)!!!
Doh! Got it.
>Are you sure adding SUM(DATEDIFF('n', confhrsfrom, confhrsto)) in your
>select doesn't work?
I get zero when I sum.
>Although it looks like the SUM functions won't do much,
p by
will probably return individual records.
I think you may need two queries here. What are you trying to achieve?
> -Original Message-
> From: hammerin hankster [mailto:[EMAIL PROTECTED]
> Sent: dinsdag 1 juni 2004 16:41
> To: CF-Talk
> Subject: Re: SUM/Convert string n
>And SUM is not working? AFAIK the result of datediff should be an int
>(Not that I use access a lot). You can always calculate the sum in CF.
>
>
>
>
>...
>
I get the following error w hen I insert your example:
The value of the attribute query, which is currently "q", is invalid.
=
And SUM is not working? AFAIK the result of datediff should be an int
(Not that I use access a lot). You can always calculate the sum in CF.
...
> -Original Message-
> From: hammerin hankster [mailto:[EMAIL PROTECTED]
> Sent: dinsdag 1 juni 2004 16:15
> To: CF-Talk
&
>What DB? Normally, datediff returns an integer that you can happily
>SUM().
Access.
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
What DB? Normally, datediff returns an integer that you can happily
SUM().
> -Original Message-
> From: hammerin hankster [mailto:[EMAIL PROTECTED]
> Sent: dinsdag 1 juni 2004 15:30
> To: CF-Talk
> Subject: Re: SUM/Convert string numeric data
>
> Any ideas
Any ideas on this?
Thanks!
> I'm doing a DATEDIFF on a range of times and then displaying the
> result wiht a VAL function to convert the minutes to hour increments:
>
> DATEDIFF('n', confhrsfrom, confhrsto) AS no_of_minute
> #Val(no_of_minute) / 60#
>
> However, I need to total the column of
>You may find this useful:
>
>http://www.macromedia.com/devnet/mx/coldfusion/articles/cfqueryparam.html
Dave,
Thanks for the pointer. Very good article.
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
> I read the description of but I'm unsure
> how to apply it here. Please enlighten me!
You may find this useful:
http://www.macromedia.com/devnet/mx/coldfusion/articles/cfqueryparam.html
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444
[Todays
>And you should really use !!!
I read the description of but I'm unsure how to apply it here. Please enlighten me!
Thanks for all the help!
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
ltype="cf_sql_date"> AND
cfsqltype="cf_sql_date">
- Original Message -
From: "Paul Vernon" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, May 28, 2004 8:37 AM
Subject: RE: SUM column data
> You are mixing up y
You are mixing up your shorthand table references with full table references
so the query should read something like this
SELECT SUM(postageCost) as totalPostage
FROM tblClientDailes cd inner join tblClients C on c.clientName =
cd.clientName
WHERE cd.dailliesDate between '#date1#' and '#date2#
.clientName
And you should really use !!!
> -Original Message-
> From: hammerin hankster [mailto:[EMAIL PROTECTED]
> Sent: vrijdag 28 mei 2004 17:31
> To: CF-Talk
> Subject: Re: SUM column data
>
> Okay, I'm being dense about this. I'm getting a syntax error
> w
Okay, I'm being dense about this. I'm getting a syntax error when I try this code:
select sum(postageCost) as totalPostage
from tblClientDailes, tblclients
inner join tblClients on tblclients.clientName = tblclientdailies.clientName
where cd.dailliesDate between '#date1#' and '#date2#'
and tblc
It's an alias for tblClientDailes (and c for tblClients)
Pascal
> -Original Message-
> From: hammerin hankster [mailto:[EMAIL PROTECTED]
> Sent: vrijdag 28 mei 2004 16:12
> To: CF-Talk
> Subject: Re: SUM column data
>
> >select sun(postageCost) as tota
>select sun(postageCost) as totalPostage
>from tblClientDailes cd
>inner join tblClients c on c.clientName = cd.clientName
>where cd.dailliesDate between '#date1#' and '#date2#'
>and c.acctStatus = 'A'
>and cd.clientName like '%marsh%'
>group by c.clientName
>
Thanks for the quick response! Excu
select sun(postageCost) as totalPostage
from tblClientDailes cd
inner join tblClients c on c.clientName = cd.clientName
where cd.dailliesDate between '#date1#' and '#date2#'
and c.acctStatus = 'A'
and cd.clientName like '%marsh%'
group by c.clientName
try that.
couple things though in your db de
, 2002 2:12 PM
To: CF-Talk
Subject: RE: sum values in list
Nope, still getting the 2.12453679578E-314
Thanks though.
Matthew P. Smith
Web Developer, Object Oriented
Naval Education & Training Professional
Development & Technology Center
(NETPDTC)
(850)452-1001 ext. 1245
[EMAIL P
From: Lofback, Chris [mailto:[EMAIL PROTECTED]]
>>Sent: Friday, November 29, 2002 1:06 PM
>>To: CF-Talk
>>Subject: RE: sum values in list
>>
>>The wrap makes this confusing. Don't miss the space in the parameters...
>>
>&g
G.
ListChangeDelims(ValueList(qMyQuery.MyColumn),","," ")
> -Original Message-
> From: Smith, Matthew P -CONT(DYN)
> [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 29, 2002 12:56 PM
> To: CF-Talk
> Subject: sum values in list
>
>
> I have a comma delimited list of integer valu
The wrap makes this confusing. Don't miss the space in the parameters...
ArraySum(ListToArray(ListChangeDelims(ValueList(qMyQuery.MyColumn),",","
")))
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscr
OK, I think this should solve your empty string problem:
Chris Lofback
Sr. Web Developer
TRX Integration
28051 US 19 N., Ste. C
Clearwater, FL 33761
www.trxi.com
> -Original Message-
> From: Smith, Matthew P -CONT(DYN)
> [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 29, 2002 1
sonal
knowledge. The #ArraySum(ListToArray(myList))# is a nifty little trick to
know, which is why I like to bounce stuff off this list.
>>-Original Message-
>>From: Lofback, Chris [mailto:[EMAIL PROTECTED]]
>>Sent: Friday, November 29, 2002 12:33 PM
>>To: CF-Talk
&g
ED]]
> Sent: Friday, November 29, 2002 1:25 PM
> To: CF-Talk
> Subject: RE: sum values in list
>
>
> Because me dba is taking a 4 day holiday weekend, and I'm
> just trying a cf
> solution.
>
>
> ;)
>
>
> >>-Original Message-
>
Because me dba is taking a 4 day holiday weekend, and I'm just trying a cf
solution.
;)
>>-Original Message-
>>From: Ken Wilson [mailto:[EMAIL PROTECTED]]
>>Sent: Friday, November 29, 2002 12:26 PM
>>To: CF-Talk
>>Subject: RE: sum values in list
>&
Why not just return the totals as a part of your query? Let the database do
it's job.
Ken
-Original Message-
From: Smith, Matthew P -CONT(DYN) [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 29, 2002 1:13 PM
To: CF-Talk
Subject: RE: sum values in list
Thanks, Mike. It works(
PROTECTED]]
Sent: Friday, November 29, 2002 18:13
To: CF-Talk
Subject: RE: sum values in list
Thanks, Mike. It works(sorta).
Below is my original code
cation & Training Professional
Development & Technology Center
(NETPDTC)
(850)452-1001 ext. 1245
[EMAIL PROTECTED]
>>-Original Message-
>>From: Mike Townend [mailto:[EMAIL PROTECTED]]
>>Sent: Friday, November 29, 2002 12:01 PM
>>To: CF-Talk
>>Subjec
Try
#ArraySum(ListToArray(myList))#
HTH
-Original Message-
From: Smith, Matthew P -CONT(DYN) [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 29, 2002 17:56
To: CF-Talk
Subject: sum values in list
I have a comma delimited list of integer values. Is there a cf function
that will a
just curious...
isn't it more efficient to have the database perform this calc?
~ dina
- Original Message -
From: "Cameron Childress" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, June 03, 2002 2:17 PM
Subject: RE: Sum Help
Queries are treated like Arrays in CF. Try this:
#ArraySum(QueryName['columname'])#
-Cameron
-
Cameron Childress
Sumo Consulting Inc.
---
cell: 678-637-5072
aim: cameroncf
email: [EMAIL PROTECTED]
> -Original Message-
> From: Kris Pilles [mailto:[EMAIL PROTECTED]]
oshua Tipton" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, June 03, 2002 1:55 PM
Subject: RE: Sum Help
> select sum(column) as sumofcolumn
> from table
>
>
> -Original Message-
> From: Kris Pilles [mailto:[EMAIL PROTECTE
select sum(column) as sumofcolumn
from table
-Original Message-
From: Kris Pilles [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 03, 2002 2:48 PM
To: CF-Talk
Subject: Sum Help
Ok.. I;ve got myself confused here...
I have a table that has some numbers lets say 5 records (50, 45, 33, 23,
SELECT SUM(currency_column) as total
FROM whatever
Mark Warrick - Fusioneers.com
Email: [EMAIL PROTECTED]
Phone: 714-547-5386
http://www.fusioneers.com
http://www.warrick.net
> -Original Message-
> From: Alii Desi
Sum them in the query or during the query output loop.
Within QUERY: Select SUM(amount) FROM table
During OUTPUT: CFSET Total = Total + Amount
> OK I have a table with multiple records each with a currency field, how
> would I output the total $ of all the records.
> Rich
>
>
>
~
; <[EMAIL PROTECTED]>
Sent: Monday, February 19, 2001 1:41 PM
Subject: RE: SUM rounding
> > Error Diagnostic Information
> > ODBC Error Code = 37000 (Syntax error or access violation)
> >
> > [Microsoft][ODBC Microsoft Access Driver] Undefined function 'Convert'
> Error Diagnostic Information
> ODBC Error Code = 37000 (Syntax error or access violation)
>
> [Microsoft][ODBC Microsoft Access Driver] Undefined function 'Convert' in
> expression.
>
> The error occurred while processing an element with a general
> identifier of
> (CFQUERY), occupying document
gn
Web Pro USA
406.549.3337 ext. 203
1.888.5WEBPRO
www.webpro-usa.com
- Original Message -
From: "Philip Arnold - ASP" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, February 19, 2001 12:43 PM
Subject: RE: SUM rounding
> > Can anyone hel
> Can anyone help me on this. here is my querey and then the
> output. it seems to be rounding the SUM (TimeTaken) as TotalTime variable.
> im tring to get it to output something like 12.03 or 03.98 ect
>
> datasource="#datasource#"
> dbtype="ODBC">
> SELECT ContestantID, SU
Have you tried doing it with SQL rather than CF? The database is generally
much faster than CF for stuff like this:
SELECT sum(column) as theSum
FROM table
Or perhaps:
SELECT column1+column2+column3 as theSum
FROM table
- Phil
philip j. kaplan : pk interactive nyc
: www.pk
>
>Why not just do it in SQL?
>
>SELECT Price, SUM(Price) As Total
> From Products
Oops, sorry about that, didn't notice the original field still in there,
obviously you can't have that along with the aggregate function, should be
just:
SELECT SUM(Price) As Total
From Products
-
> Is there a way in CF that you can add the summ of all the results in a
> certain query?
I've never tried this, but you should be able to do this like so:
Of course, you're better off letting the DB engine do this for you if that
is at all possible.
Regards,
Seth Petry-Johnson
Argo Enterp
Try this it works for me
SELECT SUM(columnName) AS Somesum
FROM tableName
H Larry Juncker
L Senior Cold Fusion Programmer
I Heartland Communications Group
Internet Division
-Original Message-
From: Miriam Hirschman [mailto:[EMAIL PROTECTED]]
Sent: Monda
Check out the trusty Ben Forta's Construction Kit starting at about page
391.
Is there a way in CF that you can add the summ of all the results in a
certain query?
Thanks,
---miriam
--
Archives: http://www.eGroups.co
At 04:08 PM 05/22/2000 -0400, you wrote:
>Is there a way in CF that you can add the summ of all the results in a
>certain query?
Why not just do it in SQL?
SELECT Price, SUM(Price) As Total
From Products
--
Archives:
Yes, if you post some code of what your trying to do, there are many people
on this list that can help you out. There are so many different ways that
it would really be helpful to see what your doing and then help you with
that. It may aid in the learning curve rather then just throwing a bunch
This is a multi-part message in MIME format.
--=_NextPart_000_002F_01BFC40C.895D2DA0
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Miriam:
If it's numerical, you can do:
select sum(myfield) as sum_myfield
and that will add them up f
73 matches
Mail list logo