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
|
|||
|
|||
String to number
I have created a column in my query that extracts a number from another
field that is a string. I need to convert my new field to be a number so I can sort properly. Any suggestions?? |
#2
|
|||
|
|||
String to number
On Fri, 18 May 2007 13:43:50 -0500, "Jeff Klein" jklein@nospam wrote:
I have created a column in my query that extracts a number from another field that is a string. I need to convert my new field to be a number so I can sort properly. Any suggestions?? Val([fieldname]) will extract the first numeric substring of the information in fieldname as a Number: e.g. Val("123") = 123, Val("0512ABC") is 512, Val("XY333") is 0 (because there's no initial number). John W. Vinson [MVP] |
#3
|
|||
|
|||
String to number
Try this ---
Val([YourString]) -- KARL DEWEY Build a little - Test a little "Jeff Klein" wrote: I have created a column in my query that extracts a number from another field that is a string. I need to convert my new field to be a number so I can sort properly. Any suggestions?? |
#4
|
|||
|
|||
String to number
Or try this:
Cint([yourtext]) remember you'll get a whole number using int. -- Maurice Ausum "Jeff Klein" wrote: I have created a column in my query that extracts a number from another field that is a string. I need to convert my new field to be a number so I can sort properly. Any suggestions?? |
Thread Tools | |
Display Modes | |
|
|