A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

calculate tax



 
 
Thread Tools Display Modes
  #1  
Old August 8th, 2009, 05:35 AM posted to microsoft.public.access.tablesdbdesign
Sean
external usenet poster
 
Posts: 491
Default 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  
Old August 8th, 2009, 06:50 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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  
Old August 8th, 2009, 07:11 AM posted to microsoft.public.access.tablesdbdesign
Sean
external usenet poster
 
Posts: 491
Default 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  
Old August 8th, 2009, 05:56 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.