Indefined If

abbaddon223

Registered User.
Local time
Yesterday, 20:10
Joined
Mar 13, 2010
Messages
162
Hi,

I'm using the below SQL statement in access but getting the following error:

"Undefined Expression If in expression" which I presume is a missing reference? But I'm not sure which to add..... Can anyone very kindly help please?

SELECT IF (t1.status = 'INCALL' AND t2.callerid IS NULL, 'DEAD', t1.status) AS status
FROM vicidial_live_agents t1 LEFT JOIN vicidial_auto_calls t2 ON t1.callerid = t2.callerid;
 
Try,
Code:
SELECT IIF (t1.status = 'INCALL' AND IsNull(t2.callerid), 'DEAD', t1.status) AS status
FROM vicidial_live_agents t1 LEFT JOIN vicidial_auto_calls t2 ON t1.callerid = t2.callerid;
 
You must us an immediate if IIF.

So change if to iif is your sql.

Good luck.
 

Users who are viewing this thread

Back
Top Bottom