Date is on or before with regard to running totals

I have a roll-up balance that is calculated from a query and it’s working nicely except for when two transactions happen on the same date. The query includes this filter

I would like the query filter to exclude any transactions that are after the current row date, down to the second, ideally. It’s common to have two transactions on the same date, or even the same minute. The date column is set to include seconds.

What would be the change needed to force the query to filter down to seconds instead of just days, which is what it’s doing now?

Change the condition to ‘Is Before’. The ones with the word ON do not account for time. They only look at date. The ones without the word ON include time in the condition.

Thanks for the clarification. I had tried that, but then the current row is excluded from the balance roll-up.

Ahh, Ok so you are trying to exclude entries AFTER the current date time. I missed that. In that case I would add an OR condition to the query to include the current row date and time. Or do you already have other conditions using AND???

I did already have other AND conditions, but that was easily remedied by changing the matching for the underlying multi-relation to a template. Thanks for the speedy help!! :folded_hands:

1 Like

No problem. Otherwise I would have maybe recommended a query on top of your query to further refine the results, but it sounds like you might have a better solution.

Those date comparisons could definitely be expanded and better described. Kind of confusing if you don’t know what to expect. My general rule when ‘ON’ is involved, is that for ON to make sense it would have to be an exact time match down to the millisecond, which is kind of unrealistic, so instead ‘ON’ just looks at date.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.