A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Use query to change Text to Number



 
 
Thread Tools Display Modes
  #1  
Old March 10th, 2006, 09:36 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Use query to change Text to Number

Is there way to change a field from numbers stored as text to numbers,
without deleting anything that is actual text? I would like to achieve the
same results as the GENERAL format in excel.

  #2  
Old March 10th, 2006, 10:00 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Use query to change Text to Number

Dear dcozzi:

Assiming the text is always a valid number, convert it. There are different
conversions depending on the type of numeric value represented, such as
CInt, CLng, CDbl, CCur. Do this in a calculated column.

Tom Ellison


"dcozzi" wrote in message
...
Is there way to change a field from numbers stored as text to numbers,
without deleting anything that is actual text? I would like to achieve the
same results as the GENERAL format in excel.



  #3  
Old March 11th, 2006, 08:42 AM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Use query to change Text to Number

If I understand right, the answer is no. Excel has no notion of a data
type for a column or field, while Access tables have strong data types.
The only thing you can store in a text field is text (even if it's a
string of numbers), and the only thing you can store in a numeric field
is a number.

But you can probably use an expression like this
IIF(IsNumeric([XXX]), Val(Nz([XXX], "")), Null)
to return a numeric value from a text field that contains a number, and
Null if the field contains anything else.

On Fri, 10 Mar 2006 13:36:30 -0800, dcozzi
wrote:

Is there way to change a field from numbers stored as text to numbers,
without deleting anything that is actual text? I would like to achieve the
same results as the GENERAL format in excel.


--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add New Field to DB Karen Database Design 7 October 19th, 2005 08:03 PM
Combo Box (1st) Populating Text Box (2nd) Field AccessRookie Using Forms 1 April 6th, 2005 11:37 PM
Help with design Ronnie Database Design 6 March 12th, 2005 02:53 PM
Here's a shocker Mike Labosh General Discussion 2 October 26th, 2004 05:04 PM
Big number gives error! Sara Mellen Running & Setting Up Queries 8 October 11th, 2004 02:48 AM


All times are GMT +1. The time now is 01:52 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.