I need help with a query. I need to filter on some Google Form data and only show the results that have been submitted AFTER a specific timestamp.

Timestamp Cell = J2 - This cell is in the following format mm/dd/yyyy hh:mm:ss

Day Query - This one seems to work ok but its only at the day level.

=query(FormResponses!A2:G,"Select * Where A > date '"&text(J2,"YYYY-mm-dd") & "'" )

Time of Day Query - This one also seems to work ok but only at the time level.

=query(FormResponses!A2:G,"Select * Where A > timeofday'" & text(J2, "HH:mm:ss") & "'" )

When I try to combine the two, it returns no results and I can not figure out why. I do see some wierd issues with the ">" in the queries above so i am second guessing the accuracy of the above queries to begin with. Does anyone have a sample of checking both date and time in a google sheets query?

  • See if this link works. docs.google.com/spreadsheets/d/…
    – PY_
    Jan 30, 2019 at 17:44
  • Thanks that worked with importrange and cell reference too. Demo here: i.imgur.com/N82AZG0.gif
    – Lod
    Jul 23, 2023 at 13:09
  • Time Format Note: The time input needs to be formated as time and not text otherwise the #N/A :Query completed with an empty output. error is thrown. So far I could only find that way to format time from text to time format: =TIME(MID(K14,1,2),MID(K14,4,2),MID(K14,7,2)) with full example here: stackoverflow.com/questions/76748966/…
    – Lod
    Jul 23, 2023 at 15:23

2 Answers 2


 "select *", 0)), 
 "select Col1 where Col1 > "&VALUE(J2), 0)), 
 {VALUE(FormResponses!A2:A), FormResponses!B2:G}, 
 {1, 2, 3, 4, 5, 6, 7}, 0))

  • This solution works perfectly. Thank you for the help!
    – PY_
    Jan 30, 2019 at 18:52

I can see there is already an answer, but is there any reason that you can't just use the Filter command?

Something like the below:


I added it to your shared sheet, please let me know if it was unsuitable.

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.