[resolved] tFilterRow - can not filter on dates

Two Stars

[resolved] tFilterRow - can not filter on dates

Hi there,
Trying to filter on a date column in v.3.2.1 but it fails with error
-- The method compareTo(Date) in the type Date is not applicable for the arguments (int)

These are my comparasions
sl_date >= 01/01/2004
sl_date <= 01/31/2004
date format is "MM/dd/yyyy".

Accepted Solutions
Community Manager

Re: [resolved] tFilterRow - can not filter on dates

Hello
sl_date <= TalendDate.parseDate("MM/dd/yyyy","01/01/2002"))

but I got error message
Syntax Error on token "&&", Expression expected after job ImportSalesData

The correct expression is:
sl_date <= TalendDate.parseDate("MM/dd/yyyy","01/01/2002")

Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

View solution in original post


All Replies
Four Stars

Re: [resolved] tFilterRow - can not filter on dates

Hello,
Instead of 01/01/2004 String for your comparaison, can you try with TalendDate.parseDate("MM/dd/yyyy","01/01/2004")) ?
Regards,
SeB
Two Stars

Re: [resolved] tFilterRow - can not filter on dates

Hello,
Instead of 01/01/2004 String for your comparaison, can you try with ?
Regards,
SeB

Hi samlleret, thank for reply.
I did put TalendDate.parseDate("MM/dd/yyyy","01/01/2004")) in Value field so my filter looks like this now
sl_date <= TalendDate.parseDate("MM/dd/yyyy","01/01/2002"))

but I got error message
Syntax Error on token "&&", Expression expected after job ImportSalesData
Community Manager

Re: [resolved] tFilterRow - can not filter on dates

Hello
sl_date <= TalendDate.parseDate("MM/dd/yyyy","01/01/2002"))

but I got error message
Syntax Error on token "&&", Expression expected after job ImportSalesData

The correct expression is:
sl_date <= TalendDate.parseDate("MM/dd/yyyy","01/01/2002")

Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

View solution in original post

Four Stars

Re: [resolved] tFilterRow - can not filter on dates

Thank shong and sorry for my mistake in my copy and paste ;-)
Two Stars

Re: [resolved] tFilterRow - can not filter on dates

Well, I am getting error on tInformixInput now.
-- SQLException: Unable to build a date Object based on localized date stream representation.
I derived schema out of real table and I am not sure why it fails. "Date Pattern" "MM/dd/yyyy" was default one chosen by schema builder.
Two Stars

Re: [resolved] tFilterRow - can not filter on dates

After fixing schema issues this line worked just fine
sl_date <= TalendDate.parseDate("MM/dd/yyyy","01/01/2002")

Thanks
One Star

Re: [resolved] tFilterRow - can not filter on dates

I have tried below formula in tMAP, but get an expression error message.
row1.DATUM >= TalendDate.parseDate("yyyy-MM-dd","2010-01-01")
What might cause the error?
Four Stars

Re: [resolved] tFilterRow - can not filter on dates

What is datatype of row1.DATUM?
You can't compare date like this in talend....
Check following post
http://www.talendforge.org/forum/viewtopic.php?id=33910
Vaibhav
Four Stars

Re: [resolved] tFilterRow - can not filter on dates

Hi how can i filter one date field to today's date.
Can you please show using tmap and tfilter row both
.
Scenario is like:
Input file excel.
Date column in MM/dd/yyyy format
Four Stars

Re: [resolved] tFilterRow - can not filter on dates

How can i filer a date to today'swhich is in format MM/dd/yyyy.

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