0

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

1 Answer 1

1

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.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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