cancel
Showing results for 
Search instead for 
Did you mean: 

Datediff issue

0 Kudos
83

Hi All,

Im really hoping someone can help me here.

I'm reporting on a date column within a table to capture the time difference between rows for each status change. I'm using the following formula Datediff('n',{AUDIT.CREATEDATE},Next({AUDIT.CREATEDATE})) which is working as expected but as the formula is within the details section it will continue down through the entire report when I need to be able to only report on the grouped data and for it to then reset back to zero after each grouped record. I have attached screenshots to hopefully detail what I have and where it is going wrong.

Accepted Solutions (0)

Answers (1)

Answers (1)

DellSC
Active Contributor

So, if I understand you correctly, you need to get the total time between the first action and the final action for each group. If that's correct, it's not going to be difficult to do. You'll basically need a formula that looks something like this:

{@ActiveTimeByGroup}
DateDiff('n', Min({AUDIT.CREATEDATE}, {MyTable.group field}), Max({AUDIT.CREATEDATE}, {MyTable.group field}))

-Dell