Help All,

I am writing a query in Informix and have been stuck on the where clause.  I have 2 CSQnames that I want to select and certain times and all others I want to show in between another time.  My query ran perfectly until I added this specific where statement.  If anyone can offer suggestions I would really appreciate it.  I am getting a general error.  In Informix since I am unable to put a if then statement in the where clause how would I rewrite my syntax?  Thanks!

SELECT
(ccd.nodeid||"-"||ccd.sessionid||"-"||ccd.sessionseqnum) as sequenceID,
ccd.sessionid as sessionid,
ccd.sessionseqnum as sequencenum,
ccd.applicationName as AppName,
csqname as CSQName, ccd.flowout, ccd.conference,

CASE WHEN contacttype=1 THEN "Incoming" 
                WHEN contacttype=2 THEN "Outgoing"
                WHEN contacttype=3 THEN "In House"
                WHEN contacttype=4 THEN "Redirect In"
                WHEN contacttype=5 THEN "Transfer In"
END as ContactType,
CASE WHEN contactdisposition = 1 THEN "Abandoned" 
                WHEN contactdisposition = 2 THEN "Handled" 
                WHEN contactdisposition = 4 THEN "Aborted"
                WHEN contactdisposition &gt;= 5 THEN "Rejected"
END as ContactDisposition,
CASE WHEN originatortype=1 THEN "Agent" 
                WHEN originatortype=2 THEN "Device"
                ELSE "Unknown"
END as OriginatorType,
CASE WHEN destinationtype=1 THEN "Agent" 
                WHEN destinationtype=2 THEN "Device"
                ELSE "Unknown"
END as DestinationType,
DATE(ccd.startdatetime) as date,
ccd.startdatetime as starttime,
ccd.enddatetime as endtime,
res.resourcename, ccd.transfer, ccd.redirect,
ccd.originatordn, ccd.destinationdn, 
crd.queuetime/86400 as queuetime,
acd.talktime/86400 as TalkTime, 
acd.holdtime/86400 as HoldTime, 
acd.worktime/86400 as WorkTime
FROM contactcalldetail ccd
                 Left JOIN contactroutingdetail crd ON crd.sessionID = ccd.sessionID
                 AND crd.sessionSeqNum = ccd.sessionSeqNum 
                 AND crd.nodeID = ccd.nodeID 
                 AND crd.profileID = ccd.profileID
                 LEFT JOIN agentconnectiondetail acd ON acd.sessionID = ccd.sessionID
                 AND acd.sessionSeqNum = ccd.sessionSeqNum 
                 AND acd.nodeID = ccd.nodeID 
                 AND acd.profileID = ccd.profileID
                LEFT JOIN resource res ON acd.resourceid = res.resourceid
left join contactqueuedetail cqd on cqd.sessionid=crd.sessionid
left join contactservicequeue csq on  cqd.targetid= csq.recordid

WHERE (
                ccd.startdatetime BETWEEN '2014-1-2 13:00:00' AND '2016-12-31 22:30:00'

      AND (
         if (csqname in ("CSQ_Emeriti" , "SOS-Emeriti") 

AND EXTEND(ccd.startdatetime, HOUR TO second) &gt; DATETIME(13:30:00) HOUR TO SECOND
                 AND EXTEND(ccd.startdatetime, HOUR TO second) &lt; DATETIME(22:00:00) HOUR TO SECOND
                                                    ) 
             or(csqname not in (“CSQ_Emeriti" , "SOS-Emeriti") 
AND 
               EXTEND(ccd.startdatetime, HOUR TO second) &gt; DATETIME(13:00:00) HOUR TO SECOND

AND EXTEND(ccd.startdatetime, HOUR TO second) &lt; DATETIME(22:30:00) HOUR TO SECOND
                                    )
                    )
                    AND WEEKDAY(ccd.startdatetime) BETWEEN 1 AND 5
                    AND (contacttype IN (1,4,5))
                    AND ccd.originatordn !='2155870700'
    )



Question: "Files" can't be resized
Answer: Click in the window to make it active, then hold ALT and hit space - a small menu will appear at the top left corner of the window. You will see:


Minimize
Maximize / Unmaximize
Move 
Resize
Always on top
Close


"Unmaximize" is present if you have the window "maximized". 
"Move" makes the arrow keys usable for moving the window (press ESC to exit this mode), same for "Resize".