In connection with a project I am importing from Excel using the Excel Buffer table. Here I’m importing time entries, with a from and to time.
As it doesn’t work to convert the time value in Excel directly from the “Cell Value as Text” in the Excel Buffer table then I was trying to do like this:
TimeTxt := ExcelBuf."Cell Value as Text";
IF EVALUATE(TimeTotal,TimeTxt) THEN;
TimeTotal := ROUND(TimeTotal * 24,0.01);
TimeTxt := FORMAT(TimeTotal);
IF EVALUATE(TimeImport."Time From",TimeTxt) THEN;
It works partly, but when time for example is 20:30, then the value coming from the Excel Buffer is 0,85416666666666663 - recalculated this is 20,5 and when converted it’s becoming 20:05 (not 20:30).
Does anyone have a better way to convert times in the Excel String format to a NAV time record?