Nine Stars

## [resolved] date math - how can Talend add or subtract X number of days?

How can you add or subtract X number of days with Talend?
For example my date is '2013-04-22' how can Talend subtract 5 days and return '2013-04-17'?

Accepted Solutions
One Star

## Re: [resolved] date math - how can Talend add or subtract X number of days?

You can use following expression to move date 5 days back

All Replies
One Star

## Re: [resolved] date math - how can Talend add or subtract X number of days?

You can use following expression to move date 5 days back

Nine Stars

## Re: [resolved] date math - how can Talend add or subtract X number of days?

Thanks oz69! Works great.
One Star

## Re: [resolved] date math - how can Talend add or subtract X number of days?

I have a excel sheet where Column B is a date and Column E is a number. I want number of days in Column E to be reduced from Column B and stored in Column F
Input be like,
Column B|Column E|Column F
2014-05-13|4|
2014-06-12|2|
Output be like,
Column B|Column E|Column F
2014-05-13|4|2014-05-09
2014-06-12|2|2014-06-10
Anybody up for help??
One Star

## Re: [resolved] date math - how can Talend add or subtract X number of days?

hi guru,
use tmap

Expression of column F:
One Star

## Re: [resolved] date math - how can Talend add or subtract X number of days?

Hi Jcs19,
You are subtracting date from date... I need to subtract number of days from date...
One Star

## Re: [resolved] date math - how can Talend add or subtract X number of days?

 Hi Jcs19,You are subtracting date from date... I need to subtract number of days from date...

What?
I thought you wanted column F = Column B(date) - Column E(number of day)
In my example, i'm subtracting column E as number of day to column B to make column F
One Star

## Re: [resolved] date math - how can Talend add or subtract X number of days?

but the datatytpe shown in expression editor is date and not integer
One Star

## Re: [resolved] date math - how can Talend add or subtract X number of days?

 but the datatytpe shown in expression editor is date and not integer

Oh yes, column E should be integer not date (I made this example too fast )