How can I use Airtable’s filterByFormula to filter records by a specific date without always retrieving the first record?

I’m trying to retrieve a record with a date of 08/01/2022, but the query always returns the first entry. Below is my revised code sample:

const target = new Date('08/01/2022').toISOString().substring(0, 10);
const client = new AirtClient({ secret: mySecret }, myBaseId);

client('dataEntries')
  .query({
    filter: "FORMATDATE({DateEntry})='" + target + "'",
    view: 'MainView'
  })
  .forEach(item => {
    const info = {
      entryDate: item.get('DateEntry'),
      category: item.get('Category')
    };
    processInfo(info);
  });

I had a similar issue when trying to filter by a specific date. The key insight for me was understanding that Airtable’s filterByFormula is sensitive to how dates are formatted. I ended up using DATESTR() instead of relying solely on FORMATDATE() to compare dates. After switching to DATESTR({DateEntry}) = ’