From: Jessica on 13 May 2010 12:13 I have loan numbers that consist of all numbers or alphanumeric fields. Not all loan numbers have the same digits, however, they are all formatted to 35 character spaces. For example, one loan might be 123 (with zeros in front) and another loan would be 1245523, and another could be 1234abc1345. I need to format those with only numbers to a number value. I have used the Val() function and it works perfect with only number values, but when there is a loan that have alphanumeric, it shows up as 0. How do it have it show the loan number with the text? For example loan 00000abc123 needs to read abc123.
From: Marshall Barton on 13 May 2010 12:58 Jessica wrote: >I have loan numbers that consist of all numbers or alphanumeric fields. Not >all loan numbers have the same digits, however, they are all formatted to 35 >character spaces. For example, one loan might be 123 (with zeros in front) >and another loan would be 1245523, and another could be 1234abc1345. I need >to format those with only numbers to a number value. I have used the Val() >function and it works perfect with only number values, but when there is a >loan that have alphanumeric, it shows up as 0. How do it have it show the >loan number with the text? For example loan 00000abc123 needs to read abc123. I think you will need to create a function to do that: Public Function Strip(v) Dim k As Long If IsNull(v) Then Exit Function For k = 1 To Len(v) - 1 If Mid(v, k, 1) <> "0" Then Exit For Next k Strip = Mid(v, k) End Function -- Marsh MVP [MS Access]
|
Pages: 1 Prev: IIF function help in query Next: Tricky Accounting query - and not sure how to build it |