Howdy from the n00b!
I am trying to get a query to pull data from a field in one table, then convert to a number, and then split the data into two fields in another table. The first part works great, the second part, not as much. I know why it's not working, but can't sort out how to handle for the occasional #Error that's returned.
So the data in Table 1 looks like this typically: "P123456/001" or "P123456 A/001", and I want the first part ("P123456") in one field as text, and the second part ("001") in the second field as numeric/double. That's fine, got that down, and it's working great!
The problem is happening when occasionally there is an entry in Table 1 that looks like this "0012345/" (still a text field); again, first part is ok ("0012345"), but the second part returns the #Error that I'm seeing.
So I know that the problem occurs because there is nothing after the "/" in the source field. Can anyone help determine how to compensate for this? I've tried IsNull, IsError, and IsNumeric, all with the same result.
Here is my formula:IIf(IsNull[ShippingSchedule]![Supplier Reference],Null,CDbl((Mid([ShippingSchedule]![Supplier Reference],InStr([ShippingSchedule]![Supplier Reference],"/")+1))))
Here is how I tried with IsNull, IsError, and IsNumeric:IIf(IsNull([ShippingSchedule]![Supplier Reference]),Null,IIf(IsNumeric(CDbl(Mid([ShippingSchedule]![Supplier Reference],InStr([ShippingSchedule]![Supplier Reference],"/")+1))),CDbl(Mid([ShippingSchedule]![Supplier Reference],InStr([ShippingSchedule]![Supplier Reference],"/")+1)),0))
Thanks in advance to anyone who can help!