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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove decimal from text field within MS Access table 2

Status
Not open for further replies.

IngDep

MIS
Feb 7, 2008
89
US
Have two tables within MS Access database - tblCaseData
and tblDetail that have a Plan code field.

tblCaseData has decimals within the Plan code field such as 286.35 whereas tblDetail has 28635.

What is the quickest method to eliminate the decimal points within the Plan code field within tblCaseData?

Currently exploring the use of the format function.

Note, tblCaseData has over 900,000 records.

Ultimately, I am interested in joining on the Plan code field for the abovementioned tables and "pulling" the Plan code description from tblDetail and populating a new table that contains all of the records from tblCaseData and the matching fields from tblDetail.

Thanks in advance.
 
I assume that these fields are text fields and not numeric. If so
Code:
UPDATE tblCaseData

SET [Plan Code] = Replace([Plan Code], ".", "")

Where Instr([Plan Code], ".") > 0
Might take a while to run with 900,000 records but it should be a one-time thing.
 
Error received upon running the following is "External name not found."



Sub UpdateTable()
Update 00002_tblCaseData

Set [Plan_Code] = Replace([Plan_Code], ".", "")

Where InStr([Plan_Code], ".") > 0

End Sub
 
Try:

Code:
Sub UpdateTable()
strSQL="Update 00002_tblCaseData " _
& "Set [Plan_Code] = Replace([Plan_Code], '.', '') " _
& "Where InStr([Plan_Code], '.') > 0 "
CurrentDB.Execute strSQL
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top