Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select (SQL) -- field does not accept NULL values
Message
From
05/02/2004 15:00:19
 
 
To
05/02/2004 07:24:30
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00692839
Message ID:
00874571
Views:
18
Is there a solution if there are multiple functions involved. For example:

select field1, sum(nullfield1/IIF(field2>0,nullfield2,nullfield3) as result from sometable group by 1


The problem is I need to run a select that has a formula for a weighted average, not the AVG() function. This requires a difficult expression with several other functions.

I also have the need for an expression in a select that divides two sum() calculations, with the second sum being multiplied by 1000 to get the units correct. I have a specialized divide() function that I wrote that works with nulls, /0 errors, but this still causes problems. Any ideas?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform