Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to subtract date2 from day, but it shows an error
Hi, it's not clear what you need to do, to giv some tips:
- You can use Date#() to tell input format of a date, Date() is to set the output format. so if your language format date is set to DD/MM/YYYY and you have a date like 20110223 you can use Date(Date#(DateField,'YYYYMMDD')) and it will be shown as 23/02/2011.
- You can't use fields created in the current LOAD, you can use a precedent load to use the calcualted fields on previous steps, so to substract date it could be:
LOAD
*,
Now()-date as day
;
LOAD
Material,
Num(... as date
...
;
Thank you for your reply. I would like to subtract The GR date from The current date.
How do I write this code
Hi @qingkong ,
Try like this in script:
=Date([GR Date],'YYYY/MM/DD')-Date(Today(),'YYYY/MM/DD') as Day
I would prefer to use Interval in this case
Ex, =Interval(Date([GR Date])-Date(Today()), 'DD') as Day
Hi, [GR Date] is left-aligned, that means it's being stored as a text, not as a number (a date is a number).
First convert it to Date with Date(Date#([GR Date], 'YYYY/MM/DD'))
To substract you can just do: Today()-Date(Date#([GR Date], 'YYYY/MM/DD'))
Thank you for solving my problem successfully