Skip to main content

Filterbyformula by select by partial dates

  • June 12, 2019
  • 1 reply
  • 12 views

Forum|alt.badge.img+5

I want to do a filterbyformula search through the api in a date field. My field is an ISO date field in YYYY-MM-DD format. Basically, I want to do a “select” call to the DB, with a filterbyformula, but only looking for a record that equals “today”, just with today’s date, but not time! (Too specific, and would fail!) So I would need to match 2019-06-12, for example, but not the full ISO string. How would I write that filterbyformula code in nodejs? It’s a headscratcher?

1 reply

Forum|alt.badge.img+3
  • Participating Frequently
  • June 13, 2019

You will want to use the DATETIME_DIFF function

For example.

DATETIME_DIFF(TODAY(), {Date A}, ‘days’)

The above formula will return the difference between in days between Today and the field {Date A}
If the difference is zero it means that the recrod’s date field is equal to today.

You may also want to see this link for a complete list of all the functions available