Google-sheets – Query runs but returns first row greater than the DATE at 00:00:00 not the row after 10:00:00

google sheetsgoogle-sheets-datesgoogle-sheets-queryworksheet-function

Trying to use the following query:

=query(WABrdg729!A:B, "select A, B where A > date '"&text(datevalue($A$6), "yyyy-mm-dd")&"' AND A > timeofday '"&text(timevalue($A$6), "hh:mm:ss")&"' limit 1")

Query runs but returns first row greater than the DATE at 00:00:00 not the row after 10:00:00.

https://docs.google.com/spreadsheets/d/18q5Y3tq0wuAeZ7aGNQy3c3jrV-pUAuKXG-Tw5bYGTI4/edit?usp=sharing

Sheet Date/Time Demo, cell E6, querying sheet WABrdg729

Best Answer

One solution is to use datetime in the select vs. separate date and time specs.
See linked sheets.
Revised query is:

="select A, B where A > datetime '"&text(datevalue($A$6), "yyyy-mm-dd")&" " &text(timevalue($A$6), "hh:mm:ss")&"' limit 1"

Could not find documentation for the query argument spec of date, timeofday, datetime. Just guessed and it worked.