M
mustish1 via AccessMonster.com
Hi:
Can any one please help me in creating query. Criteria is that:
If LstVldAccount="OtherAccount 1" then match tech_id.corp with Val(Left(
[LastValidTech].[OtherAcct1],5
If LstVldAccount="OtherAccount 2" then match tech_id.corp with Val(Left(
[LastValidTech].[OtherAcct2],5
If LstVldAccount="OtherAccount 3 then match tech_id.corp with Val(Left(
[LastValidTech].[OtherAcct3],5
If LstVldAccount is empty and tbl_ValidDisputes.LstVldTech also dont match
with tech_id.tech then it still show values from tbl_ValidDisputes
I try to write it first but it gives syntax error:
SELECT tbl_ValidDisputes.TicketNum, tbl_ValidDisputes.OtherAcct1,
tbl_ValidDisputes.OtherAcct2,tbl_ValidDisputes.LstVldAccount,
tbl_ValidDisputes.OtherAcct3, tech_id.TECH, tech_id.TECHCONT, tech_id.CORP
FROM tbl_ValidDisputes LEFT JOIN tech_id ON IIF(LstVldAccount="OtherAccount
1", Val(Left([LastValidTech].[OtherAcct1],5)), IIF(LstVldAccount =
"OtherAccount 2", Val(Left([LastValidTech].[OtherAcct2],5)), IIF
(LstVldAccount = "OtherAccount 3", Val(Left([LastValidTech].[OtherAcct3],5)),
0)))=tech_id.CORP and tbl_ValidDisputes.LstVldTech=tech_id.tech
Thanks in advance.
Can any one please help me in creating query. Criteria is that:
If LstVldAccount="OtherAccount 1" then match tech_id.corp with Val(Left(
[LastValidTech].[OtherAcct1],5
If LstVldAccount="OtherAccount 2" then match tech_id.corp with Val(Left(
[LastValidTech].[OtherAcct2],5
If LstVldAccount="OtherAccount 3 then match tech_id.corp with Val(Left(
[LastValidTech].[OtherAcct3],5
If LstVldAccount is empty and tbl_ValidDisputes.LstVldTech also dont match
with tech_id.tech then it still show values from tbl_ValidDisputes
I try to write it first but it gives syntax error:
SELECT tbl_ValidDisputes.TicketNum, tbl_ValidDisputes.OtherAcct1,
tbl_ValidDisputes.OtherAcct2,tbl_ValidDisputes.LstVldAccount,
tbl_ValidDisputes.OtherAcct3, tech_id.TECH, tech_id.TECHCONT, tech_id.CORP
FROM tbl_ValidDisputes LEFT JOIN tech_id ON IIF(LstVldAccount="OtherAccount
1", Val(Left([LastValidTech].[OtherAcct1],5)), IIF(LstVldAccount =
"OtherAccount 2", Val(Left([LastValidTech].[OtherAcct2],5)), IIF
(LstVldAccount = "OtherAccount 3", Val(Left([LastValidTech].[OtherAcct3],5)),
0)))=tech_id.CORP and tbl_ValidDisputes.LstVldTech=tech_id.tech
Thanks in advance.