Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Have a source with a column called LDate with YYYY-MM-DD format and wanted to output only records where the date is last day of the month using tmap?
What is an expression in tmap to do this?
use for tMap output or input filter (if LDate is date - mean marked as date type in tMap)
TalendDate.formatDate("yyyy-MM-dd",row1.strDate).equals(TalendDate.formatDate("yyyy-MM-dd",TalendDate.getLastDayOfMonth(row1.LDate)) )
possible minor syntax check, because of typing from memory
@TRF wrote:
Assuming LDate is never null, you can use an output filter with the following expression:
TalendDate.compareDate(TalendDate.getLastDayMonth(row1.LDate)) == 0
yes sure - it good too, just think it need to fix also
as I remember it require at least 2 or 3 parts, like:
TalendDate.compareDate(TalendDate.getLastDayMonth(row1.LDate),row1.LDate,"yyyy-MM-dd"))) == 0