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.


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


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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.