SELECT count(tony) as tonysCount, sum(jayme) as jaymesCount from orders
WHERE Abs((count(tony)-sum(jayme))/count(tony)) > 0
This is the form I use all the time. Works.
As I said at first, I work just with SQL Server and that is how it is done
there.
J
-----Original Message-----
From: Tony Weeg [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 01, 2003 12:29 PM
To: CF-Talk
Subject: RE: sql question pt 2
that doesn't jive.
why? because the values of those two things arent calculated until you get
down into the where clause qualifiers.
isnt there just a way to use those calculated values, referenced in the
beginning of the query, later on down in the
query?
...tony
tony weeg
senior web applications architect
navtrak, inc.
www.navtrak.net
[EMAIL PROTECTED]
410.548.2337
-----Original Message-----
From: J E VanOver [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 01, 2003 2:34 PM
To: CF-Talk
Subject: RE: sql question pt 2
I just work with SQL Server and there you DON'T use calculated values in the
HAVING clause. You have to re-compute
SELECT count(tony) as tonysCount, sum(jayme) as jaymesCount from orders
WHERE tony = tony HAVING Abs((count(tony)-sum(jayme))/count(tony)) > 0
-----Original Message-----
From: Tony Weeg [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 01, 2003 11:24 AM
To: CF-Talk
Subject: sql question pt 2
question:
how does one use calculated variable names(not sure if this is what they are
called) in queries, later on in the query?
ie.
select count(tony) as tonysCount, sum(jayme) as jaymesCount from orders
where tony = tony HAVING
Abs((tonysCount-jaymesCount)/tonysCount) > 0
the problem is im getting an error like....
Server: Msg 207, Level 16, State 3, Line 1 Invalid column name 'tonysCount'.
Server: Msg 207, Level 16, State 1, Line 1 Invalid column name
'jaymesCount'.
(which tony minus jayme would mean im not married anymore so it would always
= 0 :) or would my count go up...hee hee hee, just kidding..
thanks...
...tony
tony weeg
senior web applications architect
navtrak, inc.
www.navtrak.net
[EMAIL PROTECTED]
410.548.2337
________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

