September 28, 2011 at 9:10 am
Hi
I am using the round function in my select statement and it works for the following
Round(avg(h.mtr_fass_score)) as mtr_fass, <------THIS WORKS
Round(avg(case when p.mtr_unit_count is null then null else f.mtr_5100t / ( p.mtr_unit_count * 12 ) end )) as mtr_grs_rent_unit, <--- this does not work
What am i doing wrong in this case or is this possible
thanks in advance
September 28, 2011 at 9:16 am
zwheeler (9/28/2011)
HiI am using the round function in my select statement and it works for the following
Round(avg(h.mtr_fass_score)) as mtr_fass, <------THIS WORKS
Round(avg(case when p.mtr_unit_count is null then null else f.mtr_5100t / ( p.mtr_unit_count * 12 ) end )) as mtr_grs_rent_unit, <--- this does not work
What am i doing wrong in this case or is this possible
thanks in advance
Hmmmmm. . . . Define "not work".
September 28, 2011 at 9:32 am
zwheeler (9/28/2011)
HiI am using the round function in my select statement and it works for the following
Round(avg(h.mtr_fass_score)) as mtr_fass, <------THIS WORKS
Round(avg(case when p.mtr_unit_count is null then null else f.mtr_5100t / ( p.mtr_unit_count * 12 ) end )) as mtr_grs_rent_unit, <--- this does not work
What am i doing wrong in this case or is this possible
thanks in advance
My guess would be you need to either change the code so your case statement does NOT return null, perhaps return 0 instead? Or add something to your where clause. Perhaps where p.mtr_unit_count is not null. So the null values are not part of the avg and the round.
Ben
September 28, 2011 at 9:38 am
thanks that works
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply