Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Btrieve > Limit Group By ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 983 of 1011
Post > Topic >>

Limit Group By Results

by spraycan77 <webberland@[EMAIL PROTECTED] > Mar 2, 2008 at 08:08 PM

I want to only return the rows were Spent>Budget.  Any ideas how I can
do it?  I tried adding 'HAVING Spent>Budget' but I got an error.  Also
tried wrapping the select with another select and a where clause, but
that errored. Any help is appreciated.
--------------------
Select
J.Job,
J.Description,
sum(IF(Transaction_Type='Original estimate' or
Transaction_Type='Approved est changes',Amount,0)) as Budget,
sum(IF(Transaction_Type='AP cost' or Transaction_Type='JC cost',Amount,
0)) as Spent
From
JCM_MASTER__JOB_1 J Inner Join  JCT_CURRENT__TRANSACTION T On J.Job =
T.Job
Where T.Transaction_Type In ('Original estimate',  'Approved est
changes','AP cost','JC cost') And
J.Status = 'In progress' And
T.Category = '1'
GROUP BY J.Job, J.Description
 




 1 Posts in Topic:
Limit Group By Results
spraycan77 <webberland  2008-03-02 20:08:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Thu Jul 24 3:11:48 CDT 2008.