Problem with replace function.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an update query where I am trying to remove the '.' out of the version
number and populating a numeric field. On execution I get a type conversion
error which I assume is because I am trying to populate a numeric filed with
a string field.

Actual_release_numeric - is of Numeric data Type.
Actual_Release_Version - is Text data Type.

UPDATE Combined SET Combined.Actual_Release_Numeric =
Replace([Actual_Release_Version],'.','')
WHERE Combined.Actual_Release_Version Is Not Null;

Any help to get this working would be appreciated.
 
John please don't spam me! said:
I have an update query where I am trying to remove the '.' out of the version
number and populating a numeric field. On execution I get a type conversion
error which I assume is because I am trying to populate a numeric filed with
a string field.

Actual_release_numeric - is of Numeric data Type.
Actual_Release_Version - is Text data Type.

UPDATE Combined SET Combined.Actual_Release_Numeric =
Replace([Actual_Release_Version],'.','')
WHERE Combined.Actual_Release_Version Is Not Null;

UPDATE Combined
SET Combined.Actual_Release_Numeric =
Val(Replace([Actual_Release_Version],'.',''))
WHERE Combined.Actual_Release_Version Is Not Null;
 
Try using one of the conversion functions. - CLng, CDbl, or Val should all
work

UPDATE Combined
SET Combined.Actual_Release_Numeric =
CLng(Replace([Actual_Release_Version],'.',''))
WHERE Combined.Actual_Release_Version Is Not Null;


"John please don't spam me!"
 
Back
Top