filter data on time basis

Highlighted
Seven Stars

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


Accepted Solutions
Fifteen Stars TRF
Fifteen Stars

Re: filter data on time basis

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

TRF

All Replies
Six Stars

Re: filter data on time basis

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. Smiley Happy

Seven Stars

Re: filter data on time basis

hello @Sujay ,

thanks for answer,

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

 

 

Tags (1)
Fifteen Stars TRF
Fifteen Stars

Re: filter data on time basis

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

TRF
Fifteen Stars TRF
Fifteen Stars

Re: filter data on time basis

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

TRF

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog