Five Stars

can anyone help me with this query?

 

after running job it gives error like unparseble date

context.Query_string="select date_key,inc_date from date_dim where inc_date >'" +TalendDate.formatDate("yyyy-MM-dd",TalendDate.parseDate("dd-MM-yyyy",context.Last_Loaded_Date))+"'and inc_date < now()";

3 REPLIES
Highlighted
Twelve Stars TRF
Twelve Stars

Re: can anyone help me with this query?

As your date value is enclosed between '' you probably need to use a SQL conversion fonction such as to_date.
Did you try this:
context.Query_string="select date_key,inc_date from date_dim where inc_date > to_date('" +TalendDate.formatDate("yyyy-MM-dd",TalendDate.parseDate("dd-MM-yyyy",context.Last_Loaded_Date))+"') and inc_date < now()"

TRF
Ten Stars

Re: can anyone help me with this query?

context.Query_string="select date_key,inc_date from date_dim where inc_date >'" +TalendDate.formatDate("yyyy-MM-dd",TalendDate.parseDate("dd-MM-yyyy",context.Last_Loaded_Date))+"'and inc_date < now()";

missed space

context.Query_string="select date_key,inc_date from date_dim where inc_date >'" +TalendDate.formatDate("yyyy-MM-dd",TalendDate.parseDate("dd-MM-yyyy",context.Last_Loaded_Date))+"'SPACE_MUST_BE_THERE and inc_date < now()";
-----------
Five Stars

Re: can anyone help me with this query?

i will try it.