In Flexsim 2022.1, SQL queries do not appear to work when included in a function with a breakpoint (the reported exception is "No resolved tables"). I've attached a sample model that can demonstrate this behavior by toggling a breakpoint. TableQueryError.fsm
It looks like similar errors have been reported in the past, although I don't believe I've seen the issue occur in 2020/2021 versions.