Convert text to Number

G

Guest

This seems like it should be very simple but I can't seem to find a solution. Maybe I'm missing something very basic.

I'm wanting to convert the datatype of a field within a query from text to number. I can convert the data within the field during the running of a query (using the Format function). However, when I copy and paste or import into Excel it still shows it as text requiring me to convert it within Excel (which is quite easy but I would prefer not to have to do this step).

I'm aware of DateValue which converts a certain data type into a date type. Is there an equivalent such as NumberValue?

I'd greatly appreciate any help as this is holding me back from far more important things. Let me know if you need any further information
 
N

Nikos Yannacopoulos

Jason,

Use function Val(). So, if your fields is called, say, Field1, then add a
calculated field in your query like:
NumericVal: Val([Field1])
You can change NumericVal to whatever you want the alias of the calculated
field to be (as long as it is not an Access reserved keyword).

HTH,
Nikos

Jason said:
This seems like it should be very simple but I can't seem to find a
solution. Maybe I'm missing something very basic.
I'm wanting to convert the datatype of a field within a query from text to
number. I can convert the data within the field during the running of a
query (using the Format function). However, when I copy and paste or import
into Excel it still shows it as text requiring me to convert it within Excel
(which is quite easy but I would prefer not to have to do this step).
I'm aware of DateValue which converts a certain data type into a date
type. Is there an equivalent such as NumberValue?
I'd greatly appreciate any help as this is holding me back from far more
important things. Let me know if you need any further information
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top