Rich said:
You're making several mistakes especially if this is supposed to be a book keeping db. You should not be storing calculated values, use a query to display totals. You only need to store the netcost, quantity and vat rate applicable to the item.
Which mistakes?
The formula's are correct right? 19% is the VAT. So if I have the price of an amount ex VAT which is 10 euro which is 100%, then the price including VAT is 119% since the VAT is 19% right? And the reverse is also true for when I only have the amount of a product Including VAT. Am I missing something?
And yes, I know I'm trespassing on the whole "store the totals" bit when it comes to normalization. What's so bad about it? The numbers are stored in the DB. They don't change anymore, ever. But I need to be able to pull them up quickly, and they need to be stored per invoice according to dutch law. Otherwise I will need to keep paper copies of all invoices, which is what I'm trying to avoid here.
And no, its not supposed to be a bookkeeping DB. It is a client DB which includes the client data, case data, appointment data, and invoice data/products sold /services rendered per customer. The invoicing is done by access as I can make it per my needs, and the actual bookkeeping is done in another piece of software. So... it would be nice if the numbers in access round the same as in the bookkeeping software which is.... based on a database as well. So... Anyway, please remember... I am no programmer nor a professional with access. I'm just trying to get through the first year, maybe two of starting up my company and making some money. When that goes ok, I can afford to buy or maybe let someone make a more professional solution.
I'm stumped by the fact that the rounding of financial numbers in a product such as access isn't a... how would you say that in english? "program native functionality". Especially since there is a seperate type, namely currency and even euro, that you can assign to your field in the DB. My non-programmer mind says that it should be doing that automatically then, especially sincethe currency type of data is chosen. But that's just me...
It is a one user - one computer - one man company database. So... yeah, I'm storing the numbers in a table. Why not? Storage space is dirt cheap nowadays. And isn't it true that in enterprise environments, when the numbers do get stored, the server(s) CPU is massively "lightened" when it doesn't have to do all those calculations time and time again for hundreds of people and thousands of records? In my case that isn't true, since it is a one man-one computer -few clients DB. But.... I'm just wondering. I'm guessing that that is done for development purposes?
It doesn't look like I will be reaching the 2GB limit anytime soon and when that does happen in a short time.... well... then the business will be going well and a more professional solution can be bought. So what is the downside of storing them in my case? I'm not trying to be a wise-*ss or something, but I'm really wondering about that.
I'm gonna try and see how it works out when using a query but I'm afraid I'm just not skilled enough to make it do what it does in the form now by using a query. I'm limited by my skills. But... since I do like to learn I'm gonna fight with queries now.... just to see how it works and how it can be applied. I really like that you guys are pointing out of my flaws in this one so I can improve and learn.
@gemma: ok, now i understand what you meant with your post. But still... I human see that when a number is like 0,111111111111 etc. For money calculations is normally truncated and then rouned up or down. 2 is down, 3 is up etc. I'm still stumped as to why it isn't a native access function. But I will try the piece of code that is linked to on the previous page. The "banking" rounding of numbers... I hope that will be kinda easy to implement for me.
Edit: never mind trying to explain the "why not store but use query" thing to me ;-) There are probably thousands of examples readily available to you guys which I can't even start to think of... ;-)
Edit2: @Rich: Hey thanks man... I didn't even see the function you put up on the previous page until now... I'm ashamed.... I'll try that one first right now. Thanks!