filiard
filiard

Reputation: 501

How to filter date in Talend?

I need to filter an input file by date (filter out rows with date after certain point).

I feed a columnn with type "Date" to tFilterRow and try to filter out with this code:

TalendDate.compareDate(row1.contact_date, TalendDate.parseDate("yyyy-MM-dd HH:mm:ss","2016-08-01 00:00:00"))

I get this error message:

The method matches(boolean, String) in the type Operator_tFilterRow_1 is not applicable for the arguments (int, String).

I am sure I pass correct types to the function (Date and Date), so where does this error come from? How to solve it, to filter my file in another way?

Upvotes: 1

Views: 2491

Answers (1)

filiard
filiard

Reputation: 501

Turns out the function requires boolean, not an int, so I had to add " > 0 " at the end. Full condition is:

TalendDate.compareDate(row1.contact_date, TalendDate.parseDate("yyyy-MM-dd HH:mm:ss","2016-08-01 00:00:00")) > 0

Upvotes: 1

Related Questions