Try HAVING T1.balance = (SUM(T2.netd))
that is, put parentheses around the expression
Bill Cook
Kent WA USA
----- Original Message -----
From: "MJS" <[EMAIL PROTECTED]>
To: "Rbase List Server" <[EMAIL PROTECTED]>
Sent: Wednesday, September 19, 2001 2:15 PM
Subject: What's wrong with this syntax?
> Hi all.....
> I can't seem to get this to work. I get an error message that says
> -ERROR- Illegal column specification (2512)
>
> SELECT T1.patnumbr FROM patinfo T1, baldue T2 WHERE T1.patnumbr =
> T2.patnumbr GROUP BY patnumbr HAVING T1.balance = SUM(T2.netdue)
>
> If I change it to something silly like this......
>
> SELECT T1.patnumbr FROM patinfo T1, baldue T2 WHERE T1.patnumbr =
> T2.patnumbr GROUP BY patnumbr HAVING 1=1
>
> it does not give me any error message. I assume the error is after the
word
> HAVING, but I can't make it work!
>
> The columns in T1(called patinfo) are patnumbr (real), balance (currency)
> The columns in T2 (called baldue) are patnumbr (real), netdue (currency)
>
> There are lots of other columns, but I don't think that could be relevant.
> Dropping the SUM, gives the same error. Likewise, changing the order
causes the
> same error.
>
> Any ideas?
> TIA!
>
> Mike Sinclair
>
>