BrockLanders
Programmer
Hi
On this site I have found a similar example of what I am trying to accomplish but cannot seem to get it to work properly. I have an Access 2000 table with a field called CARRIER that has similar text values. An example of one of the values in the field is: PILOT (014789526).
In my query, I am trying to create a calculated field, called MyNumber, that only returns the value inside the parenthesis. So for the above example, the field MyNumber would return 014789526.
I have the following code for my calculated field, but keep getting #Error in the MyNumber field for every record.
MyNumber: IIf(nz(InStr(1,[CARRIER],"PILOT"
)>0,Mid([CARRIER],InStr(1,[CARRIER],"("
+1,InStr(InStr(1,[CARRIER],"
"
+1,[CARRIER]," "
-(InStr(1,[CARRIER],"
"
+1)),""
I believe the syntax is correct, but it just set up wrong. Any ideas?
On this site I have found a similar example of what I am trying to accomplish but cannot seem to get it to work properly. I have an Access 2000 table with a field called CARRIER that has similar text values. An example of one of the values in the field is: PILOT (014789526).
In my query, I am trying to create a calculated field, called MyNumber, that only returns the value inside the parenthesis. So for the above example, the field MyNumber would return 014789526.
I have the following code for my calculated field, but keep getting #Error in the MyNumber field for every record.
MyNumber: IIf(nz(InStr(1,[CARRIER],"PILOT"
I believe the syntax is correct, but it just set up wrong. Any ideas?