I have 17 columns in a table that are all decimal field type.
I have a computed column that calculates the average of these columns using:
This works fine but I need to ensure that the calculated figure is not greater than the lower of the last two criterias (16 & 17)
So if Criteria 16 was 2.6 And Criteria 17 was 2.3 then if the calculated amount is 2.4 then this is incorrect as its higher then the lower of the two criterias.
How do I ensure this is checked. I want it to work on insert of new records and update of the record.
Thanks
I have a computed column that calculates the average of these columns using:
Code:
(((((((((((((((((isnull([Criteria1],(0))+isnull([Criteria2],(0)))+isnull([Criteria3],(0)))+isnull([Criteria4],(0)))+isnull([Criteria5],(0)))+isnull([Criteria6],(0)))+isnull([Criteria7],(0)))+isnull([Criteria8],(0)))+isnull([Criteria9],(0)))+isnull([Criteria10],(0)))+isnull([Criteria11],(0)))+isnull([Criteria12],(0)))+isnull([Criteria13],(0)))+isnull([Criteria14],(0)))+isnull([Criteria15],(0)))+isnull([Criteria16],(0)))+isnull([Criteria17],(0)))/(17))
This works fine but I need to ensure that the calculated figure is not greater than the lower of the last two criterias (16 & 17)
So if Criteria 16 was 2.6 And Criteria 17 was 2.3 then if the calculated amount is 2.4 then this is incorrect as its higher then the lower of the two criterias.
How do I ensure this is checked. I want it to work on insert of new records and update of the record.
Thanks