So this had me baffled yesterday and it took IT support to help me out. Once they responded and explained the problem I was able to find posts in the Caspio Community with SQL calculations returning 0 instead of decimal value, but up till then I just thought I was writing the maths wrong.

I'm just adding the issue and solution again for formula tables so maybe its easier for the next person to find (or myself when I forget )

When using all integers, Caspio will return an integer unless a field includes decimal value. In my example, I was trying to calculate the percentage of a plan the user had completed. Completed items had the value of 1 so my formula summed all them and divided by 7. Instead of returning a decimal every value was 0. All I had to do was change 7 to 7.00. Other options to get a decimal easy could be to multiply a value by 1.00. I could have also changed my 1s to 1.00 but I didn't realise that maths on integers didn't quite work the same as Excel!

You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

## Question

## Jodie

Hi

So this had me baffled yesterday and it took IT support to help me out. Once they responded and explained the problem I was able to find posts in the Caspio Community with SQL calculations returning 0 instead of decimal value, but up till then I just thought I was writing the maths wrong.

I'm just adding the issue and solution again for formula tables so maybe its easier for the next person to find (or myself when I forget )

When using all integers, Caspio will return an integer unless a field includes decimal value. In my example, I was trying to calculate the percentage of a plan the user had completed. Completed items had the value of 1 so my formula summed all them and divided by 7. Instead of returning a decimal every value was 0. All I had to do was change 7 to 7.00. Other options to get a decimal easy could be to multiply a value by 1.00. I could have also changed my 1s to 1.00 but I didn't realise that maths on integers didn't quite work the same as Excel!

## Link to comment

## Share on other sites

## 3 answers to this question

## Recommended Posts

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Note:Your post will require moderator approval before it will be visible.