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!

I am appending data from a temporar

Status
Not open for further replies.

Delindan

MIS
May 27, 2011
203
US
I am appending data from a temporary table which was imported from excel so all the fields came in as text although things like salary need to be a number. My solution for this was to append into my permanent table (CurrentSalary) the val(annual Salary) and there is another field which is FXRate which is a calculation. Both these fields are defined as numbers with decimals in my CurrentSalary table. The values are coming in as texts I believe simply because the calculation for the discount rate is coming out as whole numbers...either 1 or 0 depending on what the fraction is. Is there another way I should be doing this? Here is my statement:

DoCmd.RunSQL "INSERT INTO Currentsalary ( [Personnel Number], [Annual Salary], [FXRate], [Date], [DateAdded] )SELECT Temporary.[Personnel Number], VAL(Temporary.[Annual Salary]), (val(Temporary.[Annual Salary - USD])/val(Temporary.[Annual Salary])), strdate, date()FROM [Temporary];"

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top