When Should I Create a Query by Using X++ Rather Than In AOT?

When Should I Create a Query by Using X++ Rather Then In AOT ? What are the different scenario of both usage ?

Thank you

Both are same, but the way they are going to be created and used makes the difference.

You need AOT queries for SSRS reports, list pages , views, document services, data sets.

AOT queries can be easily designed using interface and can be reusable.

Queries with more complex ranges, may be difficult to build with AOT query in that case you can use X++ queries.

docs.microsoft.com/…/query-framework-for-business-objects