I am trying to get the technician contractor(TECHCONT) of last field
technician (FS_TechID or LstVldTech). It could be in Tbl_ValidDispute
or Tbl_PPVResearch.
In table Tbl_PPVResearch first i have to match the first 5 digits of
Account number with Tech_ID.CORP and once it match i have to find last
field technician from all three
fields(FS_TechID1,FS_TechID2,FS_TechID3). First five digits of account
number in both tables are the CORP in table Tech_ID. The structure of
Tbl_PPVResearch is if FS_TechID3 is not empty it means that FS_TechID3
is a last field technician or if FS_TechID3 is empty then FS_TechID2 is
last field technician or if FS_TechID3 and FS_TechID2 is empty than
last field technician is FS_TechID1. Once i got the FS_TechID then
match it with Tech_ID.Tech and if match then get the technician
contractor from Tech_ID.TECHCONT
In another table Tbl_ValidDispute first five digits of all three
accounts are CORP. I have to match first the accounts with CORP and if
one is match then i have to match the LstVldTech with Tech_ID.Tech and
get the technician contractor (TECHCONT)
Thing which is in my mind is to write three separate queries first to
get the corp from two tables (Mid([AccountNum],2,4) AS Corp and then
write main query. Any help in creating query very appreciate.
Thanks in advance.
Tbl_PPVResearch
---------------
TicketNum Autonumber PK
AccountNum Type Text 00000-000000-00
FS_TechID1 Type Text 00000
FS_TechID2 Type Text 00000
FS_TechID3 Type Text 00000
Tbl_ValidDispute
-----------------
TicketNum
LstVldTech Type Text 00000
OtherAcct1 Type Text 00000-000000-00
OtherAcct2 Type Text 00000-000000-00
OtherAcct3 Type Text 00000-000000-00
Tech_ID
-------
ID PK
CORP Type Text 00000
Tech Type Text 00000
TECHCONT Type Text