1

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?

1

2 Answers 2

2

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

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

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:

=FILTER(FormResponses!A1:G,FormResponses!A:A>$J$2)

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, privacy policy and cookie policy

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