I lose my decimal places every time I use my append Query. I still have all my decimal places when I click on design and datasheet view, but when I go to the table wich the append query makes, the decimal places all turn into 0's. Why is it doing this??
what is the data type/format of the field in the table?
also what are some examples of numbers that you are trying to append?
can you type a similar number with the decimal points you are trying to append, directly into the table? what happens?
are there other numbers in the table which are correct?
please also paste your sql of the query here.
try putting
cdbl([tablename].[fieldname]) as [aname]
in the sql statement, where tablename is the table name, fieldname is the field name, and aname is an output field name (that doesn't appear more than once or clash with table fields.
The Data type is fixed with 3 decimal places. I originally had general, but that won't let me chose the decimal places and although the query results had decimal places, the table that the query appened to doesn't. It just has an interger in the table.
I tried going straight into the table and typing a number with decimal places like 103.078 but when I pressed enter it turned back to 103.000.
The Query SQL is as follows:
INSERT INTO [Combustion Emissions] ( Year, CO2E, Category, CO2, CH4, N2O )
SELECT [COMPRESSOR COMBUSTION EMISSIONS ACTUALS].YEAR, Sum([COMPRESSOR COMBUSTION EMISSIONS ACTUALS].[CO2 EQUIVALENT]) AS [SumOfCO2 EQUIVALENT], "Compressor Combustion" AS CATEGORY, Sum([COMPRESSOR COMBUSTION EMISSIONS ACTUALS].[CO2 EMISSIONS]) AS [SumOfCO2 EMISSIONS], Sum([COMPRESSOR COMBUSTION EMISSIONS ACTUALS].[CH4 EMISSIONS]) AS [SumOfCH4 EMISSIONS], Sum([COMPRESSOR COMBUSTION EMISSIONS ACTUALS].[N2O EMISSIONS]) AS [SumOfN2O EMISSIONS]
FROM [COMPRESSOR COMBUSTION EMISSIONS ACTUALS]
GROUP BY [COMPRESSOR COMBUSTION EMISSIONS ACTUALS].YEAR, "Compressor Combustion";
in the table design, is the field FIELD SIZE = "INTEGER"? you should change it to "DOUBLE". i did the same (INTEGER) and got your results. then changed to DOUBLE and it's fine. keept the format as FIXED,3 decimal places, just change the FIELD SIZE.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.