Question:
MS Access: How to sum columns by Expr: [F1]+[F2]. It is working only if there are values in both fields?
qazwsxedcrfvg
2008-07-05 08:15:29 UTC
Hi,
MS Access 2007: How to sum columns by Expr: [F1]+[F2] in a view. Currently it is working if there are values in both fields. But nothing happens if just one column has a value and the other not. How to make it to see no value as zerro (so that the sum works even if one field has a value of Null). DO I need to set a particular field properties. Now it is set to number, double (tried singel as well).

Your comments are appreciated.
Three answers:
Eziblogger
2008-07-06 03:22:12 UTC
Access does not know how to carry out calculations with a field that has no value. Try the following expression in your query:



Expr: IIf(Isnull([F1]),0,[F1]) + IIf(isnull([F2]),0,[F2])



With that expression, you are telling access that if F1 has no value, it should use 0. If it has a value, it should use the value. The same applies to F2. Then after that has been done, it should add both together.



---

It is also a good idea to set the default value property for those fields to 0. This can be done in table design view.

---

Hope it helps.
?
2008-07-05 08:32:09 UTC
How can you sum one column? That's a copy. You have to have two or more values for a sum. Unless you mean you want to put a total at the bottom. Then, if Access works like other MS programs (and I would not be surprised if it didn't), you total the column with the column name =SUM(CASH) In a database you shouldn't have the ability to sum part of the column - you have to select to the view and total everything.
?
2016-10-22 08:06:01 UTC
making a relationship paintings ? In my adventure my longest relationship is forty 3 years so i think of i'd desire to be doing something top. it quite is working for me, it may for you too. a million. Love and appreciate for another, deal alongside with your important different the comparable way as you anticipate to be taken care of two. Loyalty, straightforward, and reliability 3. Honesty in any respect situations, lies will discover you out and end your relationship.remember there is often an answer mutually. 4. area on your existence to do your guy or woman element and pursue your guy or woman pursuits generally, do no longer question yet have an interest. 5. preserving your previous friendships and preserving in touch. 6. relatives ties reinforced and known touch with the two factors of the relatives. 7. NO room for jealousy, in the experience that your important different has some admirers, isn't that a reliable mirrored image on your self for a reliable decision. 8. talk in many situations. communication is the appropriate element, in case you have any concerns, something it quite is bothering you, beit human beings or issues, money,in spite of that's,detect a answer mutually, if no longer seek for expert help.genuinely everyone has different needs, compromise in case you could not attain settlement 9. continually make time for those particular intimate moments, relationship yet lower back and continually save your relationship alive via surprize presents and journeys away. 10. do no longer enable youself flow, be at your appropriate in any respect situations, under no circumstances run your important different down in enterprise, in spite of if its purely a shaggy dog tale !


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...