You are not logged in.

Unanswered posts



Important! This site has been replaced. All content here is read-only. Please visit our brand-new community at https://community.talend.com/. We look forward to hearing from you there!



#1 2016-12-16 12:32:16

harkirat
Member
10 posts

harkirat said:

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?


mini_blob_20161216-0338.png
mini_blob_20161216-0340.png

Last edited by harkirat (2016-12-16 12:41:09)

Offline

#2 2016-12-16 13:25:24

rhall_2.0
Member
1251 posts

rhall_2.0 said:

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 


rilhiaSolutionsLogo_0.png

Offline

#3 2016-12-24 16:16:31

harkirat
Member
10 posts

harkirat said:

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 smile

Offline

#4 2017-02-28 06:56:34

narendarreddy
Member
3 posts

narendarreddy said:

Re: Filtering data on date bases in tmap

Hi,
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.


Regards 
Narendar

Offline

Board footer

Talend Contributor Agreement - Talend Website Privacy Policy