Change text to number

D

Donna

I have inherited a database that has a field storing currency but its
formatted as text. These are tables on a server that I link to via an odbc
connection. I can't change the table formats. Is there any way I can change
the text to a number or currency in my queries and or reports so that it will
sort by amount properly?
 
J

John W. Vinson

I have inherited a database that has a field storing currency but its
formatted as text. These are tables on a server that I link to via an odbc
connection. I can't change the table formats. Is there any way I can change
the text to a number or currency in my queries and or reports so that it will
sort by amount properly?

What's stored in the table: "415.00" or "$415.00" or "Four hundred fifteen
dollars"? or what?

If the field is numeric, you can use the CCur() function to convert text to
currency. You may need to space over the dollar sign:

CCur(Mid([fieldname], 2))
 
É

黎先生

无法安装messenger,ä¸èƒ½æ‰“开键什么的æžä¸æ‡‚.
 
S

Susan May

Bob - what is you don't want the decimal and last 2 digits in this string.
How can I revise it to look like $50,000,000. My field is stored as text due
to being imported from excel... it doesn't keep the original formatting.

Many thanks.

Susan

boblarson said:
In your query you can create a new field to sort on:

MyNewFieldNameHere:CCur(Nz([YourOriginalFieldHere],0))
--
Bob Larson

Free Tutorials and Samples at http://www.btabdevelopment.com

__________________________________


Donna said:
I have inherited a database that has a field storing currency but its
formatted as text. These are tables on a server that I link to via an odbc
connection. I can't change the table formats. Is there any way I can change
the text to a number or currency in my queries and or reports so that it will
sort by amount properly?
 
S

SANDRA D

Susan May said:
Bob - what is you don't want the decimal and last 2 digits in this string.
How can I revise it to look like $50,000,000. My field is stored as text
due
to being imported from excel... it doesn't keep the original formatting.

Many thanks.

Susan

boblarson said:
In your query you can create a new field to sort on:

MyNewFieldNameHere:CCur(Nz([YourOriginalFieldHere],0))
--
Bob Larson

Free Tutorials and Samples at http://www.btabdevelopment.com

__________________________________


Donna said:
I have inherited a database that has a field storing currency but its
formatted as text. These are tables on a server that I link to via an
odbc
connection. I can't change the table formats. Is there any way I can
change
the text to a number or currency in my queries and or reports so that
it will
sort by amount properly?
 
S

Susan May

Sandra - I don't understand your response.

SANDRA D said:
Susan May said:
Bob - what is you don't want the decimal and last 2 digits in this string.
How can I revise it to look like $50,000,000. My field is stored as text
due
to being imported from excel... it doesn't keep the original formatting.

Many thanks.

Susan

boblarson said:
In your query you can create a new field to sort on:

MyNewFieldNameHere:CCur(Nz([YourOriginalFieldHere],0))
--
Bob Larson

Free Tutorials and Samples at http://www.btabdevelopment.com

__________________________________


:

I have inherited a database that has a field storing currency but its
formatted as text. These are tables on a server that I link to via an
odbc
connection. I can't change the table formats. Is there any way I can
change
the text to a number or currency in my queries and or reports so that
it will
sort by amount properly?
 

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