Is there a way to convert the date/time values to ...
# general
l
Is there a way to convert the date/time values to a format that excludes the seconds part? I had to populate the Date Submitted for Approval field via CSV field and I had to put the seconds part per SuiteAnswers but I’m having issues where if I do math between this custom field (with seconds) vs. the standard date created field (no seconds), the result is not a decimal number but expressed in time as well. I tried removing the seconds part using this formula but it didn’t work: TO_CHAR({myfieldid}, ‘DD.MM.YYYY hh:mi AM’)
m
Nor sur to understand but maybe try TO_CHAR({myfieldid}, 'DD.MM.YYYY') || ' ' || TO_CHAR({myfieldid}, 'HH:MI AM')
l
I was able to convert it to a format without the seconds part using TO_CHAR({myfieldid}, ‘DD.MM.YYYY HH:MI’) but it now a string because of TO_CHAR and I can’t compare it to {datecreated}. I tried enclosing the TO_CHAR with TO_DATE but it is still not working
m
This formula not working ? CASE WHEN TO_CHAR({myfieldid}, 'DD.MM.YYYY HH:MI AM') = TO_CHAR({datecreated}, 'DD.MM.YYYY HH:MI AM') THEN 'Match' ELSE 'No Match' END
v
I recently worked on something similar but I used a combination of SUBSTR and TO_NUMBER to check for hours and minutes from your 'max of formula numeric' type of field. YMMV --Minute check SUBSTR(({datecreated} - {custbody_abc_date_field}), 0, 16) --Hour check SUBSTR(({datecreated} - {custbody_abc_date_field}), 0, 13)
l
Basically, I wanted to get the difference between 2 date/time fields as NUMBERS. Here are the 3 versions of the formulas:
Here are the corresponding results:
In the first row, instead of seeing 00:29 (expressed in time), my ideal result is 0.48 (29 mins/60 mins) - expressed as numbers.