Time related issue

Hi ,

I have two date start date and end date , and i want time duration in days but the problem is data is coming from task report .

a!gridTextColumn(
label:"Start Date",
field:"c6",
data:index(local!dataset.data,"c3",{})
), 

and 

a!gridTextColumn(
label:"End Date",
field:"c8",
data:index(local!dataset.data,"c11",{})

),

i need one more column which shows the duration of time for these two date .

please suggest 

  Discussion posts and replies are publicly visible

Parents Reply
  • +1
    Certified Lead Developer
    in reply to danb0002

    I suggest you write an expression rule called something like "APP_getElapsedDaysBetweenDates" that accepts two DATETIME parameters and returns a result that matches what you are after - i.e. whole numbers (0, 1, etc) for business days, or decimals to represent days and partial days, and also handles null-checking on either or both of the inputs.  After that, you can simply call that rule and pass in the two columns from your report within the logic of your a!forEach statement.  Doing it this way will make it much more easy to initially test that the math you're trying to do is both working without error, and returning the exact return value you're expecting.

Children