ExecuteSQL calculation not filtered per customer in portal
I've a lovely SQL calculation on a portal which simply shows a Select Max from a list of values.
However, on customer AAA it's showing the Max value from the entire table, which happens to be customer BBB.
Does ExecuteSQL somehow circumvent the normal behaviour of portals which is to keep their results specific to the related record upon which they reside?
Just for kicks, I tried inserting a where FKID=PKID within the SQL statement but this resulted in a '?'