Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HAVING Claus

Status
Not open for further replies.
Mar 20, 2009
102
US
Please help me figure out the correct way to write the below code:

Having SUM(ARAmount) <> 0 and Having SUM(v.InvCur) <> 0 and Having SUM(v.INV30) <>0
and Having SUM(v.INV60) and Having SUM(v.INV90) <> 0 Having and SUM(v.INV120) <> 0

Thanks!!
 

Hi,
Code:
Having SUM(ARAmount) <> 0
   and SUM(v.InvCur) <> 0
   and SUM(v.INV30) <>
   and SUM(v.INV60) <> 0
   and SUM(v.INV90) <> 0 
   and SUM(v.INV120) <> 0

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Okay, I tried that I received an error. Maybe I had something typed incorrectly!
 



Please post your entire SQL.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
maybe focus a little more:

Code:
Having SUM(ARAmount) <> 0
   and SUM(v.InvCur) <> 0
   and SUM(v.INV30 ) <>    [red]<--- there is something missing here, perhaps a 0[/red]
   and SUM(v.INV60 ) <> 0
   and SUM(v.INV90 ) <> 0 
   and SUM(v.INV120) <> 0

A Having clause also is not a whole SQL statement and to make it work you need the whole SQL statement being correct.

Bye, Olaf
 
in your orignal posted clause there's even not only the 0 missing....

Bye, Olaf.
 



It just might help to have a ZERO there.

What do you think?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top