Grid and date time subtraction in runtime

0
I have two attributes in one of my entities: StartTime and EndTime. In runtime I would like to fill a column of my grid with the subtraction of EndTime from StartTime, but converted to an integer. Is it possible to do that using a grid?
asked
1 answers
0

You can use Date function calls to get the time difference between StartTime and EndTime as a decimal value as described here: https://docs.mendix.com/refguide/between-date-function-calls

You can then round (or floor or ceil) that value to an integer as described here: https://docs.mendix.com/refguide/mathematical-function-calls

To display this value in a grid, you will need an integer attribute member on your entity. This could be a calculated attribute as described here:

https://docs.mendix.com/refguide/attributes#value

If the data source of your list is a microflow, you can calculate the value in this microflow in a loop, then you would not need a calculated attribute.

Hope this helps,

Thorsten

answered