Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » Access

Change text to number

 
Jump to:  
 
Donna
PostPosted: Tue Sep 23, 2008 2:13 am    Post subject: Change text to number
       
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?
 

 
boblarson
PostPosted: Tue Sep 23, 2008 2:38 am    Post subject: RE: Change text to number
       
In your query you can create a new field to sort on:

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

Free Tutorials and Samples at LINK

__________________________________


"Donna" wrote:

Quote:
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?
 

 
boblarson
PostPosted: Tue Sep 23, 2008 2:39 am    Post subject: RE: Change text to number
       
Oh, and the reason I included the NZ function was to handle nulls so it
didn't return errors for null values.
--
Bob Larson

Free Tutorials and Samples at LINK

__________________________________


"Donna" wrote:

Quote:
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?
 

 
John W. Vinson
PostPosted: Tue Sep 23, 2008 4:14 am    Post subject: Re: Change text to number
       
On Mon, 22 Sep 2008 21:13:00 -0700, Donna <Donna@discussions.microsoft.com>
wrote:

Quote:
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))
--

John W. Vinson [MVP]
 

 
黎先生
PostPosted: Tue Sep 23, 2008 7:59 am    Post subject: Re: Change text to number
       
无法安装messenger,不能打开键什么的搞不懂.

"Donna" <Donna@discussions.microsoft.com> 写入消息
news:75D43870-981F-461C-BE73-F75F6CA983BC@microsoft.com...
Quote:
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?
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates

gratka WebCatalog Stron - wielkopolskie Listwy forum ślubne kalkulator kredytowy