Convert text to number

Surf_gal

New Member
Joined
Aug 29, 2003
Messages
22
I have a table that was uploaded into a table but one column has a field of numbers (no alphas) with a data type of "text" instead of "number". Is there a way to convert it to a number data type? Will switching the data type to number do the trick or will that cause a problem? Or is there a function I can use in a query (i.e the value function in Excel converts text fields)? Any help would be greatle appreciated.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
You might be able to use the N() Function to convert the text to numeric values. After applying N(), you can copy and paste special the values to get the numbers you desire.
 
Upvote 0
N() is a function? So in a query, can I use it in creating a field like

NUM: n([PS_ZY_VESTING_TBL - DEV]![GRANT_NBR])
 
Upvote 0
in your table, create a new table column for the numeric value of your data, then save & close.

then, run an update query that updates the new column to Val(expr), which converts your string expression to a numeric value...
 
Upvote 0
Also of potential interest are the conversion functions, e.g., CCur([myTable.Field1])
 
Upvote 0
Another function of interest might be Isnumeric() to test whether or not a string qualifies as a number. You can use this before you actually do the conversion so that you don't receive errors:
Code:
Iif(IsNumeric([Your_Field]),Val([Your_Field]),Null)
Also of potential interest are the conversion functions, e.g., CCur([myTable.Field1])
Nate, I've never come across this function and it's not included in the VBA help files. What does this function do?

*edit* Never mind, I see that it converts to Currency
 
Upvote 0
Dugantrain said:
Nate, I've never come across this function and it's not included in the VBA help files. What does this function do?

*edit* Never mind, I see that it converts to Currency
It strikes me as odd that you won't find them in the front-end help of Access, but the VBE help files do cover 'Conversion Functions.'

I have found them to be useful in the past with my recordsets, and you can use others, e.g., CLng, CDbl, etc...
 
Upvote 0

Forum statistics

Threads
1,221,618
Messages
6,160,872
Members
451,674
Latest member
TJPsmt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top