Kelvin
Kelvin

Reputation: 585

Query Google Sheet with date

I have a google sheet (https://docs.google.com/spreadsheets/d/1qMarTzWRzfGdX9i3irtpms94jpv6hVvRqUSoP7-rdwE/edit?usp=drive_link), Sheet Data record all event date and title, Sheet Today Event show all today event,

In sheet data, there are 3 records 18-08-2023 Event A 19-08-2023 Event B 20-08-2023 Event C

I make a query at TodayEvent!A2 =QUERY(Data!A1:B, "SELECT A, B WHERE A = TODATE(NOW())", 0) but don't know why only the 19-08-2023 be queried when time is 20-08-2023 00:28:00, timezone of sheet is GMT+8.

Please advise how I can query to correct records when dealing with date/time records.

Upvotes: 0

Views: 62

Answers (1)

rockinfreakshow
rockinfreakshow

Reputation: 30240

You may try:

=filter(Data!A:B,Data!A:A=today())

OR

=QUERY(Data!A:B,"WHERE A=date'"&text(today(),"yyyy-mm-dd")&"'",)

enter image description here

Upvotes: 1

Related Questions