One Star

Filtering data on date bases in tmap

I have data in source table for 21 September and 22 September but I want to load data into target table only for 21 September .
I am getting an error "invalid character constant" and I have tried all system rountine nothing is working .
Note : "create_date " data type is date "
Can somebody please tell me , how can we filter data on date level in tmap?

Fifteen Stars

Re: Filtering data on date bases in tmap

I assume your dates are stored as dates in your database. If that is the case you cannot filter them as you are trying. You need to filter them as dates or convert them to a String and then filter them using String comparisons (....but not using the == operator). 
Dates are stored down to the millisecond in Java. Since you are filtering using Java, you need to consider this. So if you want to filter out by day (as described) you can either use the Talend date routines to convert the date to a String (only the day part e.g. "yyyy-MM-dd") and using String matching to filter. Or you need to use a between operator to say you want dates that fall between  23:59:59.999 20th September and 00:00:00.000 22nd September.
There are lots of tutorials on this if you Google 
Rilhia Solutions
One Star

Re: Filtering data on date bases in tmap

Thanks for your reply.
If  I talk about solution ,I can filter out my data in tmysqlinput component in SQL QUERY ( Where condition) .Instead of Converting date into String and again string into date. 
I am looking for very simple solution like filtering  data  based on date in tmap. There will be a way to do as Talend  is based on JAVA .May be I have to build rountine ,that rountine need to call in tmap Smiley Happy
Four Stars

Re: Filtering data on date bases in tmap

In tMap we have function like "GetPartOfDate" in that "DAY_OF_MONTH" pass this value in TalendDate functions by using this function we can get the day from given date.
compare that value to required value.