partridge80
Technical User
In the following problem the variables 'BoxtypeA - H are varchars. A '1' can appear in any of them. bx1 - 8 are the corresponding money fields of BoxtypeA - H. I want Box1 to be the sum of bx's where there is a '1' in the corresponding Boxtype A- H. So what is wrong with this? (From a very novice user)
‘Box1’= Case
When BoxtypeA = ‘1’ Then bx1
When BoxtypeB =‘1’ Then ‘Box1’ + bx2
When BoxtypeC =‘1’ Then ‘Box1’ + bx3
When BoxtypeD =‘1’ Then ‘Box1’ + bx4
When BoxtypeE =‘1’ Then ‘Box1’ + bx5
When BoxtypeF =‘1’ Then ‘Box1’ + bx6
When BoxtypeG =‘1’ Then ‘Box1’ + bx7
When BoxtypeH =‘1’ Then ‘Box1’ + bx8
END
‘Box1’= Case
When BoxtypeA = ‘1’ Then bx1
When BoxtypeB =‘1’ Then ‘Box1’ + bx2
When BoxtypeC =‘1’ Then ‘Box1’ + bx3
When BoxtypeD =‘1’ Then ‘Box1’ + bx4
When BoxtypeE =‘1’ Then ‘Box1’ + bx5
When BoxtypeF =‘1’ Then ‘Box1’ + bx6
When BoxtypeG =‘1’ Then ‘Box1’ + bx7
When BoxtypeH =‘1’ Then ‘Box1’ + bx8
END