• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 319
  • Last Modified:

Access query not keeping decimal places from underlying table

Hi

I have an Access query that totals the Amount column (2 decimal places)but somehow doesn't keep the decimal places. How do I get around this?
SELECT Transactions.ID, Transactions.SupplierName, Transactions.Reference, Transactions.[Transaction Date], Sum(Transactions.Amount) AS Invoiced
FROM Transactions
GROUP BY Transactions.ID, Transactions.SupplierName, Transactions.Reference, Transactions.[Transaction Date], Transactions.DocType
HAVING (((Transactions.DocType)="Invoice"));

Open in new window

0
Murray Brown
Asked:
Murray Brown
1 Solution
 
jdc1944Commented:
do you have the data type for the 'Amount' set to double in its table?
0
 
jdc1944Commented:
sorry i meant to say that for the 'Amount' field check the table for the following settings, presuming you want it to 2dp

Data Type: Number
Field Size: Decimal
Scale: 2
Decimal Points: 2
0
 
clarkscottCommented:
Are you displaying this in a texbox on a form?  If so, make sure your textbox isn't formatted to no decimal.
Scott C
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
peter57rCommented:
Do you mean that :
if the sum is 123.45 then the result shows as 123
OR
if the sum is 123.45 it shows as 12345

which?
0
 
Paul_Harris_FusionCommented:
If this is simply how the results show when you execute the query directly then you have three options:
1. Create a report based on the query and specify the exact formatting you want
2. Create a form based on the query and specify the exact formatting you want
3. Modify your query to return a formatted string (below)

SELECT Transactions.ID, Transactions.SupplierName, Transactions.Reference, Transactions.[Transaction Date], Format(Sum(Transactions.Amount),"0.00") AS Invoiced
FROM Transactions
GROUP BY Transactions.ID, Transactions.SupplierName, Transactions.Reference, Transactions.[Transaction Date], Transactions.DocType
HAVING (((Transactions.DocType)="Invoice"));
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
THANKS VERY MUCH
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now