1
votes

I have a spread sheet in google sheets where 'column A' has a date in this format: 20181130.

i am looking to do a query for:

=query(Table1, "select A, B, C, WHERE A = Today(),-1)

But the formats for the today function don't match the column A format, so criteria doesn't find any matches. any help would be appreciated!

CB

2
ok getting closer, looks like now it says: Error Query completed with an empty output. I should have mentioned the "date" in A1, 20181130 is actually the output of the a formula, =MID(Z1,20,8) ...not sure if that affects the query you provided or notCarlo B.
thanks guys, combining both your statements seems to have solved the problem!Carlo B.

2 Answers

1
votes

Try this one:

=query(Table1, "select A, B, C, WHERE A = date'"&text(Today(),"YYYY-MM-dd")&"'")
0
votes

According to a Comment, your issue is essentially (other than syntax, which Adam K. seems to have corrected) of trying to compare a Text string to a Date. You might want to change the A1 formula, say to:

 =date(MID(Z1,20,4),MID(Z1,24,2),MID(Z1,26,2))