How to get last hourmeter reading from a machine?
Have a table with columns A - timestamp B - placa (machine code) C - hourmeter D - last hourmeter
When inserting a new entry, the hourmeter canยดt be smaller than the last hourmeter inserted.
So I need to get the last hourmeter, and if itโs higher than the one inserted, it will block the insertion of the new one (needs to type a new number)
tried this function at Last Hourmeter column LOOKUP(maxrow(app, timestamp), app, placa, hourmeter)
Got error message saying the result type was a number, when it expected a text.
What should I use in place?
[_THIS]>MAX(SELECT(TableName[HOURMETER],[PLACA]=[_THISROW].[PLACA]))
Thanks Aleksi, the formula works, but I would still like to SHOW to the operator what was the previous hourmeter.
And by using โMAX(SELECT(TableName[HOURMETER],[PLACA]=[_THISROW].[PLACA]))โ on the โLast Hourmeterโ column, I also get the message that the result (number) does not matches the expected type (text)
I find it funny that itโs result canยดnt be shown and yet the same result is valid and used when comparing which one is larger, in your expression!
Is the Last Hourmeterโs column type a number? The error message is saying that the result is a number but your column is waiting for a text value.
Wellโฆ when I wrote this topic, and when I replied above, I checked 3 times and the column was a NUMBER type. I even changed on purpose to TEXT type just to be sure the inverse wouldnยดt work (it did not)
Now I went there and changed again to number typeโฆ and it workedโฆ
Good to hear itโs working now.
User | Count |
---|---|
35 | |
35 | |
28 | |
23 | |
18 |