extract part of field?

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.
 
A

Aag

Sorry the field contains the following value:

"inv nr: 9999 of ABC"
I only need the 9999 which is the actual invoice number.
 
F

fredg

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)
 
A

aag

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.
.
 
F

fredg

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))
 
Top