General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only