Is there any documentation on Simple Queries inside Advanced Queries?

I recently learned that one can insert the Simple Query inside an Advanced Query like so:

;; simple query
{{query (and (property due-date <%today%>) [[Reminder]] ) }}

;; advanced query
#+BEGIN_QUERY
{:title "Reminders for today"
:query (and (property due-date <%today%>) [[Reminder]] )
:collapsed? false}
#+END_QUERY

Is there any documentation as how far this embedding of simple queries in advanced queries can go?

For example the following gives an “Invalid query” error:

#+BEGIN_QUERY
{:title "Reminders for today"
:query (and  [[Reminder]] (between <%yesterday%> -7d) )
:collapsed? false}
#+END_QUERY

so (between <%yesterday%> -7d) is off-limits for Simple Queries inside Advanced Queries syntax while it works in simple queries (Live queries):

{{query (and  [[Reminder]] (between <%yesterday%> -7d) ) }}
1 Like

If a syntax works in simple queries, but not in advanced queries, there is a bug.

pff… found the “bug”: the -Xd should be placed in quotes for it to work in Embedded Simple Queries in Advanced Query Syntax …

#+BEGIN_QUERY
{:title "Reminders for today"
:query (and  [[Reminder]] (between <%yesterday%> "-7d") )
:collapsed? false}
#+END_QUERY

(i submitted a bug report nevertheless, as Simple Queries should work “as-is” in Advanced Queries, thanks for the insight)