How to calculate hour between to different datetime varaible

sanjeevdalelasanjeevdalela Member Posts: 45
edited 2009-02-11 in Navision Attain
plz help me for calculate two datetime varible in hours

startdatetime:=010407 07:10 AM
enddatetime:=050407 06:10 PM
how to calculate hours above two datetime variables
i try the duration variable its give the error
overflow ](*,)
Sanjeev Kumar Dalela
Technical Consultant
(Dataman Computer Systems P Ltd.)

Comments

  • AlbertvhAlbertvh Member Posts: 516
    Hi,

    Try this
    StartDateTime := CREATEDATETIME(010407D,071000T);
    EndDateTime := CREATEDATETIME(050407D,181000T);
    Elapsed := EndDateTime - StartDateTime;
    MESSAGE('elapsed = %1',FORMAT(Elapsed));
    

    Where Elapsed is type Duration



    Albert
Sign In or Register to comment.