Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2002 SUM Function Datatype Error

Status
Not open for further replies.

arb4

Technical User
Sep 5, 2002
5
CA
I am writing an SQL Pass-Through Query in Access 2002 to retrieve Data from an Oracle database. Everything works OK except my aggregate SUM function is not returning Decimal data -- looks like it is truncating the amounts. I've seen a thread in here (thread68-100697) that recommends reverting to Access 2000 but that's not a realistic solution for me (I don't control what application versions the company uses). It also gives some kind of workaround from Microsoft, but it appears to be a SQL Server function and I'm not familiar enough with the Oracle functions to adapt it. Can anyone help me get aggregated decimal data?

The SQL is as follows:

SELECT xx.PROJ_ID, SUM(xx.SALE_AMT) AS REVENUE
FROM PROJ_SALE_TABLE xx
WHERE xx.PROJ_ID='OBNFJ'
GROUP BY xx.PROJ_ID

SALE_AMT is stored in the database with 4 decimal places, but most of the data only uses 2 (dollars & cents). I've tried using a TO_NUMBER function, but that doesn't seem to help (perhaps I'm not taking advantage of all of the arguments). Many thanks for any help you can offer!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top