
Text / Date calculations
Hi, I seem to be going round in circles and losing the plot for something which should be really simple.
I import a file which has a text field which is a time stamp in the format yyyy/mm/dd hh:mm:ss for this particular problem all I need to do is get the date - not much of a problem other than its in yyyy/mm/dd I can't seem to flip it so that I can get the days elapsed between the timestamp and a manually entered date which is in the format dd/mm/yyyy days(f1,f2) returns a function not defined error which I guess is either because f1 is a calculated field or the wrong format. Any Suggestions Please?
-
Thanks getting closer when I try
let DD := split('esd', "-");
let DD2 := date(number(item(DD, 0)), number(item(DD, 1)), number(item(DD, 2)));
DD2the value in ESD is 2020-09-24T23:00:00+00:00 however DD2 returns 31/08/2020, so I tried to break down a bit more
let dateArr := split('ESD', "-");
let Year := number(item(dateArr, 0));
let Month := number(item(dateArr, 1));
let Date := number(item(dateArr, 2));
Date + "/" + Month + "/" + YearReturns 0/9/2020
let dateArr := split('ESD', "-");
let Year := number(item(dateArr, 0));
let Month := number(item(dateArr, 1));
let Date := number(item(dateArr, 2));
date(Date + "/" + Month + "/" + Year)Returns 01/01/1970
Also tried another idea whilst not 100% or foolproof a it would apply to around 70% of the imported records, setting a trigger on update to set the field to AESD:=today() but this randomly seems to set either todays date or yesterdays (oviously putting in a check to only update if blank)