formula to convert date and time files for program other than Crystal

Version 1
    Question

    Some customers want to report or retrieve info via Access

    Answer

    Please find below the formulae for date and time fields. These examples are looking at call creation date and time. You would need to modify the formulae if you wanted to report on other date and time fields.

     

    Date:

     

    NumberVar Yyyy;

    NumberVar Mm;

    NumberVar Dd;

     

    Yyyy := Truncate ({CALL_HDW.CALLDAT_HDW} / 65536);

    Mm := Truncate (({CALL_HDW.CALLDAT_HDW} - (Yyyy * 65536)) / 256);

    Dd := {CALL_HDW.CALLDAT_HDW} - (Yyyy * 65536) - (Mm * 256);

     

    Date (Yyyy, Mm, Dd)

     

     

    Time:

     

    NumberVar TimeField := {CALL_HDW.CALLTME_HDW};

     

    NumberVar nHour := Truncate (TimeField / 16777216);

    NumberVar nMinute := Truncate ((TimeField - (nHour * 16777216)) / 65536);

    NumberVar nSecond := Truncate ((TimeField - (nHour * 16777216) - (nMinute * 65536)) / 256);

    NumberVar nHunSec := TimeField - (nHour * 16777216) - (nMinute * 65536) - (nSecond * 256);

     

    Time (nHour, nMinute, nSecond)

    Environment

    HD Classic all versions