Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Informix Datetime issue

Status
Not open for further replies.

BlackDevilWS6

Technical User
Jul 12, 2012
1
US
I know that it's maybe very easy but I need your help.

SELECT hsplit.row_date, hsplit.starttime, hsplit.acd, hsplit.split, hsplit.acdcalls, hsplit.anstime, hsplit.abncalls, hsplit.abntime, hsplit.dequecalls, hsplit.outflowcalls, hsplit.acceptable, hsplit.servicelevel, hsplit.callsoffered
FROM hsplit
WHERE
NVL (hsplit.callsoffered, 0) + NVL (hsplit.abncalls, 0) + NVL (hsplit.acdcalls, 0) +
NVL (hsplit.outflowcalls, 0) + NVL (hsplit.dequecalls, 0) + NVL (hsplit.anstime, 0) +
NVL (hsplit.abntime, 0) + NVL (hsplit.acceptable, 0) <> 0
AND
TO_CHAR(hsplit.row_date,'%Y%m%d') || (LPAD (hsplit.starttime, 4, '0')) >= to_char( ((CURRENT HOUR TO MINUTE) - (Interval (02:00) HOUR TO MINUTE)), '%m/%d/%Y %H:%M' ) -- I need to pull the data for last 120 minutes

Thanks,
 
What is the data type of hsplit.starttime ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Provided that this is correct:
TO_CHAR(hsplit.row_date,'%Y%m%d') || (LPAD (hsplit.starttime, 4, '0'))

then use this:
>= TO_CHAR(current year to minute - 2 units hour,'%Y%m%d%H%M')

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top