A family of Microsoft relational database management systems designed for ease of use.
A combination of the Replace() and Int() functions should work:
Int(Replace(<TheField>, "-", ""))
-- Roger Carlson
MS Access MVP 2006-2010
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I need to convert text data stored in a field from this format 00000-0000-00 to:
For example: if the field contains 00059-1234-01, I want to convert to a field to show 00059123401 and another field to show 59123401. Can you help?
A family of Microsoft relational database management systems designed for ease of use.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
A combination of the Replace() and Int() functions should work:
Int(Replace(<TheField>, "-", ""))
-- Roger Carlson
MS Access MVP 2006-2010
Format will also work:
Format([TheField])
Format([TheField], "00000000000") will give you the leading zeros back (00059123401).
-- Roger Carlson
MS Access MVP 2006-2010
Create a query based on the table.
Let's say the field is named MyField.
Create a calculated column
JustDigits: Replace([MyField],"-","")
and another one
RealNumber: Val(Replace([MyField],"-",""))
CStr([YourNumberField])
Build a little, test a little.
Thank you so much, Roger and HansV! They work!!! This saves me hours of searching in the Help section.
One more thing, how do I convert the real number to text format in a query? ie 59123401 as text and not as a number.