Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: skmani on October 26, 2014, 07:03:00 AM

Title: Query to select last two hours data in OCS
Post by: skmani on October 26, 2014, 07:03:00 AM
Our requirement is to filter the data for last two hours data(it may change the hours based on the requirement ).The data is keep inserting from web service to the outbound database. Here we need to capture the data based on the custom field. In outbound table we use one column called custom01 which have the data insertion time based on the custom01 we need filter out the last two hours ( the time may vary based on the business requirement  ) to dial the data .

I have written query to fetch the last two hours but not sure how to put filter in callinglist

select * from walg_pc_callinglist  where to_date(SUBSTR(custom01, 1,8),'mm/dd/yy') =  TO_DATE(to_char(SYSDATE,'mm/dd/yy'),'mm/dd/yy') and EXTRACT(hour FROM to_timestamp(custom01,'mm/dd/yy hh24:mi:ss')) >( EXTRACT(HOUR FROM to_timestamp(to_char(systimestamp,'mm/dd/yy hh24:mi:ss'),'mm/dd/yy hh24:mi:ss'))-2)

Please provide solutions to filter the data
Title: Re: Query to select last two hours data in OCS
Post by: cavagnaro on October 26, 2014, 02:28:43 PM
Your filter should be the WHERE part only, go to advanced View. Probably you will need to create to lines of it on CME due the length of the query.