Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
madhubabum
Creator
Creator

How to add days to my existing field

Hi Experts

i want to add 45 days to my existing field

4 Replies
pokassov
Specialist
Specialist

Hi!

LOAD Emp_Id,

     Emp_Name,

     Type,

     date(Emp_Date,'MM/DD/YYYY')as Emp_Date,

     if(Type='Permenant',date(Emp_Date+45),date#('01/01/2020','MM/DD/YYYY')) as Change_Emp_Date

FROM

(ooxml, embedded labels, table is Sheet1);

tresesco
MVP
MVP

Your dates are actually string in sample, you need to convert them to proper dates. Try like:

if(Type='Permenant', Date(Date#(Emp_Date, 'DD/MM/YYYY')+45)),MakeDate(2020,1,1)) as Change_Emp_Date

sujeetsingh
Master III
Master III

Why this repeated

when already there is one

Re: How to add days to Existing date Field ?

avinashelite

try like this :

Emp:

LOAD

    Emp_Id,

    Emp_Name,

    Type,

    Emp_Date

  

FROM

Book2.xlsx

(ooxml, embedded labels, table is Sheet1);

LOAD Emp_Date,

      if(Type='Permenant',Date#(date(Emp_Date+45)),date(MakeDate(2020,01,01),'DD-MM-YYYY')) as Change_Emp_Date

    // Interval(Change_Emp_Date-Emp_Date,'DD' ) as Diff

Resident Emp;

please find the attachment for the solution