Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filter accounts based on percent value
Message
 
 
To
26/10/2006 17:44:04
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01164810
Message ID:
01164885
Views:
7
>ROUND THE SUM
>
>select Account, sum(balance) as Total_Balance, sum(iif(MyCond,value,0)) as MyCond_Balance from ... group by 1 ;
>having MyCond_Balance/EVL(ROUND(Total_Balance,6),.NULL.) > 0.1
>
>OR
>select Account, sum(balance) as Total_Balance, sum(iif(MyCond,value,0)) as MyCond_Balance from ... group by 1 ;
>having ROUND(MyCond_Balance,6)> 0.1 * ROUND(Total_Balance,6)
>
>
Thanks, Fabio. I haven't realised that a/b > 0.1 is the same as a > (b*0.1) The second part takes care of b=0 automatically.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform