how to know minute difference on nav 2015 with report builder

Hi Expert.

I am having difficulties on showing minutes difference on report builder. if I have A as datetime value and B and datetime value. what should I use to see the minutes difference on report

many thanks,

Best Answer

Answers

  • KishormKishorm Member Posts: 921
    You should calculate that in NAV and then include the value in the dataset, e.g. Something like...
    MinsDiff := (ToDT - FromDT) / 60000;
    
  • Hi @Kishorm : I tried that but the report tells me that the date is not valid. I describe MinsDiff as time and integer also not working.

    any ideas?

    thanks,

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    diff variable should be integer and from and to values should be date time type..
  • KishormKishorm Member Posts: 921
    edited 2016-11-08
    @yonhantdaenta89@hotmail.com - MinsDiff should be a Decimal for the above code.

    If you want whole number of minutes then make it an Integer and change the code slightly...
    MinsDiff := ROUND((ToDT - FromDT) / 60000,1);
    

    Also, make sure you are not trying to format the MinsDiff as a Date in your RDLC report layout (Text Box Properties --> Number) - leave this as Default
  • Kishorm wrote: »
    @yonhantdaenta89@hotmail.com - MinsDiff should be a Decimal for the above code.

    If you want whole number of minutes then make it an Integer and change the code slightly...
    MinsDiff := ROUND((ToDT - FromDT) / 60000,1);
    

    Also, make sure you are not trying to format the MinsDiff as a Date in your RDLC report layout (Text Box Properties --> Number) - leave this as Default


    tried this one, also same error
  • KishormKishorm Member Posts: 921
    Ah, it could be because the DateTime field(s) are blank, try changing the code to...
    IF (FromDT = 0DT) OR (ToDT = 0DT) THEN
      MinsDiff := 0
    ELSE
      MinsDiff := ROUND((ToDT - FromDT) / 60000,1);
    
  • KishormKishorm Member Posts: 921
    Great, in that case please mark my post above as having answered the question (you should have a "Did this answer your question YES / NO") option. :)
Sign In or Register to comment.