Hello @andréal1
I'm afraid that's not possible with the tools currently available in ACC.
The reverse operation is possible (generate the SQL code from a queryDef, with the xtkQueryDef.BuildQuery() method) but unfortunatly retrieving a query from a SQL does not seem available.
If you need to get a schema from a SQL table, you can have a look at the BuildSqlSchema method (xtk:sqlSchema). It could help but you won't be able to get a query from WHERE clause.
It used to work with SQLDATA expression use (put directly SQL code into a query), but is no longer available (deprecated) for security reasons. Depending on your instance version, you should be able to use it, but keep in mind that is no longer supported by latest versions of ACC (and has a big security issue)
Cedric