Taizooooon
Taizooooon

Reputation: 91

Convert time stamp to date in query select statment in google spreadsheet

I am importing data from a form data collection sheet and I would like to change timestamp to just date to make it easier for me to filter.

What I want to do is to be able to filter data based on the dates that I provide so for example I would like to filter data between 4/20/2013 and 5/1/2013. Currently my time stamp is in datetime format making it difficult to do so.

is there a way where I can do Query(A:D,"select date(A), B, C",1) so my table only has date not datetime or

if I set A1 = 4/20/2013, B1 = 5/1/2013, C1 = Query(Sheet1!A:D,"select A, B, C, D where A >= date'"""&A1&"""' and A <= date'"""&B1&"""'",1)

Please help me with getting to this point

Thank you

Khokhar

Upvotes: 0

Views: 10474

Answers (1)

Mogsdad
Mogsdad

Reputation: 45750

Have a look at todate() here.

=Query(Sheet1!A:D,"select A, B, C, D where todate(A) >= date'" &A1& "' and todate(A) <= date'" &B1& "'",1)

Upvotes: 6

Related Questions