PDA

View Full Version : Problematic Percents!



prabhafriend
03-22-2009, 03:04 PM
Hello Friends. I am Prabha Karan from Thanjavur (South India). Currently I am working in a small Retail tool using access which mostly deals with the items having MRP and also a default tax percentage for that product. In our country (India) a new kind of tax called VAT (Value Added Tax) has been introduced. Most of the Commodities have 4% as the default VAT percent and some have 12% and some don’t have VAT Tax. I assumed the number data type to store the default percentage of an item and tried to format as a percentage. Here the problem came. Let’s Assume…
Item Table Structure:
Id : Auto number
Name : String
MRP : Currency
VAT : Number (Formatted as Percentage)
Item Table Data:
Id Name MRP VAT
1 Item1 10.00 4
2 Item2 15.00 12
3 Item3 25.00 (Null)
Query1 Structure:
Column1 : Item Name
Column2 : Quantity
Column3 : (MRP x Quantity) + (MRP*VAT)
Expected Query1 Result:
Column1 Column2 Column3
Item1 2 28
Actual Query1 Result:
Column1 Column2 Column3
Item1 2 60
Why this happen? How to overcome this? I also tried to give the VAT percent data in decimals i.e. giving as .4 or .12 but I didn’t accept it. Why? Thanks in advance.

CreganTur
03-23-2009, 05:10 AM
Exactly which number data type did you use? You may need to explicitly declare this as either a decimal or double data type, so that the decimals are handled correctly.