Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

filter data on time basis

hello everyone,

how can we filter data on time basis ?,

i have a tmysql input source data, i want to filter data on time ranges.

input source:-

 

IDdatarecord_added_dt
874264541.494892019-08-13 00:01:02
874264441.49492019-08-13 08:01:06
874264341.495152019-08-13 09:00:00
874264241.495752019-08-13 00:01:32
874264141.495972019-08-12 23:59:32
874264041.498062019-08-13 17:02:02
874263941.499462019-08-13 00:02:32
874263841.503222019-08-12 23:58:31
874263741.504142019-08-12 23:59:03
874263641.509512019-07-09 03:11:59
874263541.504142019-07-10 03:11:56
874263441.50952019-07-10 03:11:56

 

Ques:-  i want to filter data between 06:00:00 to 18:00:00 time ranges .

please help,

 

 

thanks in advanced,

Regards,

Manish

Labels (2)
1 Solution

Accepted Solutions
TRF
Creator III
Creator III

select * from yourTable where DATE_FORMAT(dt, '%H%i') between '0600' and '1800'

View solution in original post

4 Replies
Sujay1
Creator
Creator

Hi @vitspltalend  if your data is coming from databases like mysql you can filter it in DB itself and bring necessary data right ? Something like 

 

select * from table where dt between '2012-03-11 06:00:00' and '2012-05-11 18:00:00' ;

cause filtering in source(DB) is much more effective than bringing all data to talend and then filter it. Just a food for thought. 0683p000009MACn.png

Anonymous
Not applicable
Author

hello @Sujay ,

thanks for answer,

It will work fine only for one day data, in my requirements there is multiple days.

 

 

TRF
Creator III
Creator III

select * from yourTable where DATE_FORMAT(dt, '%H%i') between '0600' and '1800'
TRF
Creator III
Creator III

Did it help?
If so, thanks to mark your case as solved.