extract part of field?

  • Thread starter Thread starter Aag
  • Start date Start date
A

Aag

I have a field that contains the folowing value:
Inv nbr: 9999 of Vendor

What I want to do is extract only the invoicenr which is
the numeric value: 999
Can anyone point me into the right direction please?
TIA.
 
Yes. cInt(Right(cStr(Vendor),3)) this will convert the number to a string,
then take the rightmost 3 characters (999) and convert it back to an
integer.
 
Sorry the field contains the following value:

"inv nr: 9999 of ABC"
I only need the 9999 which is the actual invoice number.
 
I have a field that contains the folowing value:
Inv nbr: 9999 of Vendor

What I want to do is extract only the invoicenr which is
the numeric value: 999
Can anyone point me into the right direction please?
TIA.

Your example shows 9999 Number (4 digits)
but your wanted result shows 999 (3 digits).
Do you want the entire number or just the first 3 digits?

If the number is always at the beginning of the field, then to get the
entire number:
NewField = Val([OldField])

To get just the first 3 digits:
NewField = Left([OldField],3)
 
What I want from "inv nbr: 9999 of Vendor"
is only the number 9999, this number always contains
4 chars! and is aways at the same pos.

-----Original Message-----
I have a field that contains the folowing value:
Inv nbr: 9999 of Vendor

What I want to do is extract only the invoicenr which is
the numeric value: 999
Can anyone point me into the right direction please?
TIA.

Your example shows 9999 Number (4 digits)
but your wanted result shows 999 (3 digits).
Do you want the entire number or just the first 3 digits?

If the number is always at the beginning of the field, then to get the
entire number:
NewField = Val([OldField])

To get just the first 3 digits:
NewField = Left([OldField],3)
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
What I want from "inv nbr: 9999 of Vendor"
is only the number 9999, this number always contains
4 chars! and is aways at the same pos.
-----Original Message-----
I have a field that contains the folowing value:
Inv nbr: 9999 of Vendor

What I want to do is extract only the invoicenr which is
the numeric value: 999
Can anyone point me into the right direction please?
TIA.

Your example shows 9999 Number (4 digits)
but your wanted result shows 999 (3 digits).
Do you want the entire number or just the first 3 digits?

If the number is always at the beginning of the field, then to get the
entire number:
NewField = Val([OldField])

To get just the first 3 digits:
NewField = Left([OldField],3)
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.


From the original message I thought inv nbr: was the name of the field
in which you had "9999 of Vendor" as data.
OK.
If the number is always in the same position, the 10th character, use:
NewField = val(Mid([FieldName],10))
 
Back
Top