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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
convert "Text" into "Number"
I have a a table (due to many reasons!), my query of "price" is text,
Now, I want to convert it from "Text" into "Number". (Because later on i need to export it to other system) Thanks a lot , dear expert! -- Allen Phailat Wongakanit |
#2
|
|||
|
|||
convert "Text" into "Number"
"ali" wrote in message
... I have a a table (due to many reasons!), my query of "price" is text, Now, I want to convert it from "Text" into "Number". (Because later on i need to export it to other system) CInt or CLng should do it. Keith. |
#3
|
|||
|
|||
convert "Text" into "Number"
Clng and Cint will round the number,
34.4 will turn to 34 if you don't want the number to round, use CDbl([YourNumber]) or Val([YourNumber]) -- Good Luck BS"D "Keith Wilby" wrote: "ali" wrote in message ... I have a a table (due to many reasons!), my query of "price" is text, Now, I want to convert it from "Text" into "Number". (Because later on i need to export it to other system) CInt or CLng should do it. Keith. |
#4
|
|||
|
|||
convert "Text" into "Number"
On Tue, 11 Mar 2008 02:22:00 -0700, ali wrote:
I have a a table (due to many reasons!), my query of "price" is text, Now, I want to convert it from "Text" into "Number". (Because later on i need to export it to other system) I'll reluctantly have to disagree with both Ofer and Keith here. If the price is a currency value, you want to convert it to Currency: CCur([price]) will do it, with some caveats. For one, CCur will only work if the number in the text field is just a number. Whitespace and currency symbols such as $ are ok, but if there is other text in the field, or if there are NULL values, you'll get errors. What is actually IN your Price field? Could you post some examples? And what are some of the reasons that you are storing non-currency data in a Price field? -- John W. Vinson [MVP] |
#5
|
|||
|
|||
convert "Text" into "Number"
Hi Keith,
I can't seem to convert text a field into a number using query. FILED_ID: Cint([TableName]![FieldName]) When I use the expression above, it just returned an empty text filed after executing the query. Please help...this conversion is driving be nuts. Thank you. "ali" wrote: I have a a table (due to many reasons!), my query of "price" is text, Now, I want to convert it from "Text" into "Number". (Because later on i need to export it to other system) Thanks a lot , dear expert! -- Allen Phailat Wongakanit |
#6
|
|||
|
|||
convert "Text" into "Number"
On Tue, 29 Dec 2009 15:47:02 -0800, E-mail report using Lotus Notes rather t
rosoft.com wrote: Hi Keith, I can't seem to convert text a field into a number using query. FILED_ID: Cint([TableName]![FieldName]) When I use the expression above, it just returned an empty text filed after executing the query. Please help...this conversion is driving be nuts. What's the context? What's the actual value of FieldName? You should be using . rather than ! as a delimiter here, and (if there is only one field of this name) you can omit the TableName altogether: FILED_ID: CInt([TextFieldName]) will return an integer 3 if TextFieldName is a Text field in the query containing the text string "3". If the field contains "Three" instead... you've got a harder problem! -- John W. Vinson [MVP] |
#7
|
|||
|
|||
convert "Text" into "Number"
Keith the below expression, there is a limit on how many rows it can convert
to long Integer. Is there another way to extent to great then the number below? test: CLNG([FieldName]) only convert text to numbers up until 900099999 thanks. "Ofer Cohen" wrote: Clng and Cint will round the number, 34.4 will turn to 34 if you don't want the number to round, use CDbl([YourNumber]) or Val([YourNumber]) -- Good Luck BS"D "Keith Wilby" wrote: "ali" wrote in message ... I have a a table (due to many reasons!), my query of "price" is text, Now, I want to convert it from "Text" into "Number". (Because later on i need to export it to other system) CInt or CLng should do it. Keith. |
#8
|
|||
|
|||
convert "Text" into "Number"
On Tue, 29 Dec 2009 16:58:01 -0800, E-mail report using Lotus Notes rather t
rosoft.com wrote: Keith the below expression, there is a limit on how many rows it can convert to long Integer. Is there another way to extent to great then the number below? There is no limit on the number of *rows*. test: CLNG([FieldName]) only convert text to numbers up until 900099999 There is a limit on the size of the number. A Long Integer (the output of CLng) is a 32 bit signed integer with a valid range of values from -2147483648 through 2147483647. 900099999 is well within this range: ?clng("900099999") 900099999 ?clng("2147483647") 2147483647 ?clng("2147483648") generates an overflow error Originally, you were using CInt(), which generates a small (16 bit) integer, which is limited to the range -65536 to 65535. Could you explain the nature of the data, the range of values you're using, and just what you are trying to accomplish? -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|