kevinh2320
Board Regular
- Joined
- May 13, 2016
- Messages
- 61
I have a column in one of my Access queries called CustomerName_DBAName. Below is an example of what that data typically looks like.
CustomerName_DBAName
JOHN T. PUBLIC
JAKE A. SMITH JR.
ABC COMPANY
STEVE JONES - DBA: SUPER STORE
BIG COMMUNICATIONS, LLC
SOME BUSINESS INC.
JOE SLOW - DBA: QUICK DELIVERY
I've added two new columns to my query called CustName and Business name. I need to help with expressions to separate the CustomerName part of the CustomerName_DBAName and the DBAName part of the from the DBAName part of CustomerName_DBAName column and put that data in their respective new columns.
I tried this expression "CustName: Left([CustomerName_DBAName],InStr(1,[CustomerName_DBAName],"-")-1)" for the CustName column. It returns the customer name for those entries that contain a hyphen. But, I only get a "#func!" error for those without a hyphen.
Any help would be greatly appreciated.
The end result should look like this:
<tbody>
</tbody>
CustomerName_DBAName
JOHN T. PUBLIC
JAKE A. SMITH JR.
ABC COMPANY
STEVE JONES - DBA: SUPER STORE
BIG COMMUNICATIONS, LLC
SOME BUSINESS INC.
JOE SLOW - DBA: QUICK DELIVERY
I've added two new columns to my query called CustName and Business name. I need to help with expressions to separate the CustomerName part of the CustomerName_DBAName and the DBAName part of the from the DBAName part of CustomerName_DBAName column and put that data in their respective new columns.
I tried this expression "CustName: Left([CustomerName_DBAName],InStr(1,[CustomerName_DBAName],"-")-1)" for the CustName column. It returns the customer name for those entries that contain a hyphen. But, I only get a "#func!" error for those without a hyphen.
Any help would be greatly appreciated.
The end result should look like this:
CustomerName_DBAName | CustName | BusinessName |
JOHN T. PUBLIC | JOHN T. PUBLIC | |
JAKE A. SMITH JR. | JAKE A. SMITH JR. | |
ABC COMPANY | ABC COMPANY | |
STEVE JONES - DBA: SUPER STORE | STEVE JONES | SUPER STORE |
BIG COMMUNICATIONS, LLC | BIG COMMUNICATIONS, LLC | |
SOME BUSINESS INC. | SOME BUSINESS INC. | |
JOE SLOW - DBA: QUICK DELIVERY | JOE SLOW | QUICK DELIVERY |
<tbody>
</tbody>