Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Debugging this SQL for the HAVING clause
Message
From
23/06/2006 16:06:04
 
 
To
23/06/2006 14:44:00
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01131279
Message ID:
01131303
Views:
10
This message has been marked as the solution to the initial question of the thread.
>But, if I add an HAVING clause, I have an error on the HAVING clause complaining that it is invalid:
>
>
>SELECT Affiliate.NoMember,SUM(Affiliate.Amount) AS Amount,MAX(Member.Numero) AS Numero,MAX(Member.FirstName) AS FirstName,;
> MAX(Member.LastName) AS LastName;
> FROM Affiliate;
> INNER JOIN Member ON Affiliate.NoMember=Member.Numero;
> WHERE Affiliate.Period<=ldDate AND Affiliate.NoCheque=0;
> GROUP BY NoMember;
> HAVING Amount>100
>
>

Amount is ambiguous here; are you referring to the SUM you just computed or the original Amount field. Try using SUM(Affiliate.Amount) in the HAVING clause instead.

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform