Basically that looks all OK; I could imagine that the actual amount of the row returned with the first query is not exactly 5454 but maybe 5453.99999 or something … any rounding issue?
No, this makes absolutely no sense … but without seeing the real data it’s hard to tell what’s wrong … ???
In Standard NAV “Amount” in “Sales Invoice Header” (T112) is a FlowField, thus culculated on demand. So I guess there was some customization done, maybe a little bug in there?!
Alternatively you could use the NAV C/FRONT “API” to use the C/AL command stack (thus CALCFIELDS and FlowFields) but I have no experiences how to use that with Excel …
As normally a real FlowField does not even exist within the SQL table you cannot use it in the WHERE clause.