Indefined If (1 Viewer)

abbaddon223

Registered User.
Local time
Yesterday, 21:48
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;
 

pr2-eugin

Super Moderator
Local time
Today, 05:48
Joined
Nov 30, 2011
Messages
8,494
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;
 

jdraw

Super Moderator
Staff member
Local time
Today, 00:48
Joined
Jan 23, 2006
Messages
15,394
You must us an immediate if IIF.

So change if to iif is your sql.

Good luck.
 

Users who are viewing this thread

Top Bottom