What you will fix

A QUERY date filter can fail or return unexpected rows when the date criterion is written like ordinary text or when the source column contains text instead of real dates. In this exercise, the cutoff is September 29, 2026, so only the October 1 row should remain.

Learning objectives

Open the practice workbook

HANDS-ON PRACTICE

Practice in your own copy

Make your own Google Sheets copy with the same data, formulas, formatting, filter and frozen header. The original remains unchanged.

Make a Google Sheets copy (access required) ↗View original

Sign in to Google. If the original is not publicly shared, download the full workbook and import it into Google Sheets, or paste the example data into your own sheet.

Sample data

DateAmount
2026-09-28120
2026-10-01240

A1:B3 is the source table. Column C is intentionally blank; D2 is used for the QUERY formula so the output can spill to the right.

Google Sheets practice workbook showing the complete Date and Amount source table before the QUERY formula is checked.

Fix the QUERY date criterion

Step 1: Check A2 and A3 before changing the formula. They should be real Google Sheets date values displayed as 2026-09-28 and 2026-10-01. If an imported value is plain text, convert or re-parse the source date first; changing only the query string does not repair text dates.

The Google Sheets source table is selected so the Date and Amount inputs can be checked before running QUERY.

Step 2: Select D2 and enter =QUERY(A1:B3,"select A,B where A >= date '2026-09-29'",1), then press Enter. Inside the query string, date is a keyword and the literal date is enclosed in single quotes in yyyy-mm-dd order.

=QUERY(A1:B3,"select A,B where A >= date '2026-09-29'",1)
Google Sheets with D2 selected, the complete QUERY formula visible in the formula bar, and the source table visible for comparison.

Step 3: Verify the spill from D2:E3. The output header is Date | Amount, and the only data row is 2026-10-01 | 240 because September 28 is before the September 29 cutoff.

Checkpoint

Output cellExpected value
D2Date
E2Amount
D32026-10-01
E3240

These cells are the QUERY spill result. Do not type the four values manually; they must be produced by the formula in D2.

Common mistakes and fixes

If the query reports a parse error, inspect the criterion first. The date literal must appear inside the query string as date '2026-09-29'. Keep the outer query string in double quotes and the date itself in single quotes.

If the formula runs but returns no expected date rows, inspect column A. Values that merely look like dates can still be text after an import. Fix the source type rather than wrapping the QUERY in an error-hiding formula.

If the result cannot expand, clear any content in D2:E3 other than the formula in D2. QUERY returns an array and needs empty cells for its spill range.

Independent practice

Temporarily change A2 to a real date value of 2026-09-30. With the same cutoff, both source rows should then satisfy the condition. Restore A2 to 2026-09-28 when you finish so the checkpoint returns to one matching row.

Key takeaways

  • ✓QUERY date criteria use the literal form date 'yyyy-mm-dd'.
  • ✓The source date column must contain real date values, not text that only looks like a date.
  • ✓The headers argument is 1 because A1:B1 is the header row.
  • ✓The formula in D2 spills a two-column result, so its destination cells must be empty.
  • ✓With the original sample, the only matching row is 2026-10-01 | 240.
QUICK CHECK

Check your understanding

Answer four questions about the practice sheet.

1. Which QUERY fragment correctly represents the cutoff date?
2. Why is the final QUERY argument 1 in this lesson?
3. What should the original sample return as its data row?
4. What should you check if a date-looking source value is not filtered correctly?

Next lesson

Continue in the troubleshooting path with the next lesson after you can distinguish QUERY date literals from ordinary text criteria.