AlanP Posted March 6, 2008 Posted March 6, 2008 Hi everyone...lost on how to resolve this. Using the GetAsNumber ( P# ) to convert (for example) 012345 numbers ("P#" field) to 12345 or 001234 to 1234. This works great. The problem comes in with some (P#) that are three digits 000123 and GetAsNumber removes all zeroes and shows 123. We need to *always* have 4 numbers (so it should be 0123). So anything that has three zeroes needs to return 0xxx (to make it a four digit number from six) and everything else just needs to remove the one or two zeroes (xxxx or xxxxx)from the six digits. Any ideas how to resolve this? Thank you in advance!
comment Posted March 6, 2008 Posted March 6, 2008 Try: SerialIncrement ( "0000" ; P# ) The result is text - "0123" is not a number.
AlanP Posted March 6, 2008 Author Posted March 6, 2008 Thanks comment! : I was commenting to my co-worker that this will take my hours to figure out but the guys and gals that do this all the time will know exactly what to do in seconds! :
Fitch Posted March 6, 2008 Posted March 6, 2008 There's also the "old school" way: Right( "0000" & P# ; 4 ) But Michael's way wins for elegance.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now