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!

Update Query Losing Decimal Places

Status
Not open for further replies.

Dave177

Programmer
Jan 9, 2005
165
GB
Hi there,

I've got the [tblRegMonHolderExp] which is a holding table of data imported from a delimited text file. What I am trying to do is import it into [tblRegMonExp] but no matter what I do the numbers are losing their decimal places.

The code for the update query is:
Code:
INSERT INTO tblRegMonEXP ( WeekNo, Code, SubCode, Activity, Area, Workshop, PActual, PPlanned, AttendanceActual, AttendancePlanned, ReportingYear, ImportDate )
SELECT tblRegMonHolderEXP.Field1, tblRegMonHolderEXP.Field2, tblRegMonHolderEXP.Field3, tblRegMonHolderEXP.Field4, tblRegMonHolderEXP.Field5, tblRegMonHolderEXP.Field6, Val([Field7]) AS 7, Val([Field8]) AS 8, Val([Field9]) AS 9, Val([Field10]) AS 10, [Enter Year eg 2008-2009] AS [Year], Date() AS ImportDate
FROM tblRegMonHolderEXP;
If I view the query it looks ok and shows the numbers as decimals where appropriate. However, if I run the query the values for Field7, Field8, Field9 and Field10 all change back to whole numbers when updated in tblRegMonExp. I've checked the design of tblRegMonExp and it clearly has these fields set to "long integer" and decimal places are set to "Auto".

What am I doing wrong??

Dave
 
long [!]integer[/!]
Use single, real, decimal or currency.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV,
Brilliant. Thanks for your help.

Dave
 
Brilliant? Basic number theory?

"Don't be irreplaceable. If you can't be replaced, you can't be promoted."
 
I believe Duane has been kind enough to share his brilliance over time, as well!

"Don't be irreplaceable. If you can't be replaced, you can't be promoted."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top