Trim Query

KevW

Registered User.
Local time
Today, 00:14
Joined
Nov 11, 2005
Messages
41
Using the built in function within access 2000 how can I do the following

I have the following types of number in a table

84125
80245

I want to be able to trim the leading 8 of the first number but on secon number I need to trim the 80 off the number.

I can quite easily trim off the 8 off both numbers t am left with a leading 0 on the second number. This has to also be trimmed.

The number will always be 5 digits long


Is there anyway of doing this by using the built in function Len or is there another way

Thanks
 
How about:
Code:
Public Function TrimNum(InNum As String) As String

If Mid(InNum, 2, 1) = "0" Then
   TrimNum = Right(InNum, Len(InNum) - 2)
Else
   TrimNum = Right(InNum, Len(InNum) - 1)
End If

End Function
 

Users who are viewing this thread

Back
Top Bottom