S
Susan
I apologize in advance if this was covered elsewhere, I wasn't quite sure how
to word my search on this.
I have 2 tables with the following fields:
- VendorList ( vendorName, vendorCode, acctRepCode )
- AcctRepList ( repLastName, repFirstName, rep3digitCode, rep2digitCode)
Basically the Account Rep codes used to be 2 digits for a long time, but for
expansion purposes and future purposes we have moved over to using 3 digit
codes. The problem is that, some rep codes have been updated to the 3 digit,
some have been left alone with the 2 digit code.
I'm working in Design mode, so please keep this in mind, as my SQL coding
skills are not that great.
My question is--is there a way to do this:
I wanted to query a VendorList.vendorCode with AcctRepList.repLastName
For AcctRepList.repLastName, I want it to first see if
VendorList.acctRepCode is Null, 2, or 3 digits
if Null, fill field with "Invalid Rep Code"
if 2 digits, try to join with AcctRepList.rep2digitCode
if 3 digits, try to join with AcctRepList.rep3digitCode
All of this--for one field.
Is this possible?
Thanks in advance!
Susan
to word my search on this.
I have 2 tables with the following fields:
- VendorList ( vendorName, vendorCode, acctRepCode )
- AcctRepList ( repLastName, repFirstName, rep3digitCode, rep2digitCode)
Basically the Account Rep codes used to be 2 digits for a long time, but for
expansion purposes and future purposes we have moved over to using 3 digit
codes. The problem is that, some rep codes have been updated to the 3 digit,
some have been left alone with the 2 digit code.
I'm working in Design mode, so please keep this in mind, as my SQL coding
skills are not that great.
My question is--is there a way to do this:
I wanted to query a VendorList.vendorCode with AcctRepList.repLastName
For AcctRepList.repLastName, I want it to first see if
VendorList.acctRepCode is Null, 2, or 3 digits
if Null, fill field with "Invalid Rep Code"
if 2 digits, try to join with AcctRepList.rep2digitCode
if 3 digits, try to join with AcctRepList.rep3digitCode
All of this--for one field.
Is this possible?
Thanks in advance!
Susan