uniroyal2001
Programmer
Hello All,
I am trying to use this mentioned CASE statement in a Access query.
Any leads in this matter is greatly appreciated.
thanks in advance
John Pasron
I am trying to use this mentioned CASE statement in a Access query.
Any leads in this matter is greatly appreciated.
Code:
SELECT
VALUE(G.TEAM,' ') AS CBT_TEAM,
VALUE(L.PSYS_COLLECTOR_ID,' '),
VALUE(L.PSYS_TEAM_ID,' ') AS PSYS_TEAM,
H.LEGAL_NAME AS CUSTOMER_NAME,
CASE
WHEN L.PSYS_COLLECTOR_ID = 'CTA'
AND G.TEAM <> ' ' THEN G.TEAM
WHEN L.PSYS_COLLECTOR_ID = 'CTA'
AND G.TEAM = ' ' THEN C.TEAM
WHEN L.PSYS_COLLECTOR_ID <> ' '
AND L.PSYS_COLLECTOR_ID <> 'CTA' THEN L.PSYS_TEAM_ID
WHEN G.TEAM <> ' ' THEN G.TEAM
WHEN C.TEAM <> ' ' THEN C.TEAM
ELSE '????'
END AS TEAM
John Pasron