Forum Discussion
VAT calculation
- Jul 19, 2024
Your method works, but you can simplify it by using:
```sql
CCur(Round([Gross Amount] * [VAT Percentage] / (100 + [VAT Percentage]), 2))
```
This https://vatcalculatorsa.co.za/ method keeps it as currency and exports correctly to Excel.
Your method works, but you can simplify it by using:
```sql
CCur(Round([Gross Amount] * [VAT Percentage] / (100 + [VAT Percentage]), 2))
```
This https://vatcalculatorsa.co.za/ method keeps it as currency and exports correctly to Excel.
- StormingJul 22, 2024Brass Contributor
NO MORE RESPONSES PLEASE, THIS IS AN OLD THREAD.
- StormingJul 21, 2024Brass Contributor
not sure why people are now replying to my original post which was 4 years ago.
- Jul 21, 2024
Hi,
I don't know why you got the reply by luise 4 years after the discussion. I replied to warn everybody who reads it (and especially as it is marked as "best response"), that it uses the buggy Round() function, which nobody should use, let alone when calculating with money.
Servus
Karl
- StormingJul 22, 2024Brass Contributor
- Jul 21, 2024
Hi,
A warning to you and the OP who marked your suggestion as best response:
You should never include the Round() function into anything that has to do with money, because it does not round commercially but uses mathematical or so called banker's rounding, i.e. 5 is rounded down to the nearest even number. This is an ancient problem of the Round() function and discussed a million times since it was introduced with Access 2000.
Therefore Gustav in his suggestions uses the Format() function or a user defined function to round commercially and avoids the rounding errors that happen with Round().
Servus
Karl
****************
Access News, Forever, DevCon
Access-Entwickler-Konferenz AEK - 19./20.10. Nürnberg