If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
calculate tax
I have a database with a table in it.
There are three columns They are Gross, Net & Vat How can I get it to calculate the Net and Vat values by entering the total gross amount I have tried =Nz([gross]*0.115) but this isn't working I put this in the default value field Can anyone help |
#2
|
|||
|
|||
calculate tax
On Fri, 7 Aug 2009 21:35:01 -0700, Sean
wrote: I have a database with a table in it. There are three columns They are Gross, Net & Vat How can I get it to calculate the Net and Vat values by entering the total gross amount I have tried =Nz([gross]*0.115) but this isn't working I put this in the default value field Can anyone help Neither the net nor the VAT fields should *EXIST*. Storing derived data such as this in your table accomplishes three things: it wastes disk space; it wastes time (almost any calculation will be MUCH faster than a disk fetch); and most importantly, it risks data corruption. If one of the underlying fields is subsequently edited, you will have data in your table WHICH IS WRONG, and no automatic way to detect that fact. Just redo the calculation whenever you need it, either as a calculated field in a Query or in the control source of a Form or a Report textbox. A Default value will apply only to newly created records at the instant the record is created, and therefore cannot reference the Gross field, since it has no value at that instant. -- John W. Vinson [MVP] |
#3
|
|||
|
|||
calculate tax
Is there anyway that I can create a query or report that will calculate it
for me or should I export the data into excel for example and do it there I want to make it as simple and easy for the operator to use without too many steps "John W. Vinson" wrote: On Fri, 7 Aug 2009 21:35:01 -0700, Sean wrote: I have a database with a table in it. There are three columns They are Gross, Net & Vat How can I get it to calculate the Net and Vat values by entering the total gross amount I have tried =Nz([gross]*0.115) but this isn't working I put this in the default value field Can anyone help Neither the net nor the VAT fields should *EXIST*. Storing derived data such as this in your table accomplishes three things: it wastes disk space; it wastes time (almost any calculation will be MUCH faster than a disk fetch); and most importantly, it risks data corruption. If one of the underlying fields is subsequently edited, you will have data in your table WHICH IS WRONG, and no automatic way to detect that fact. Just redo the calculation whenever you need it, either as a calculated field in a Query or in the control source of a Form or a Report textbox. A Default value will apply only to newly created records at the instant the record is created, and therefore cannot reference the Gross field, since it has no value at that instant. -- John W. Vinson [MVP] |
#4
|
|||
|
|||
calculate tax
On Fri, 7 Aug 2009 23:11:01 -0700, Sean
wrote: Is there anyway that I can create a query or report that will calculate it for me Of course; either! In a query just type VAT: Nz([gross])*0.115 in a vacant Field cell. On a form or report, set the Control Source of a textbox to =Nz([gross])*0.115 The same can be done with any other needed expression. -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|