Jul 01, 2021 10:49 AM
Dear ones, I need help. I’m using a filter on another system that searches the result based on a certain date.
If I inform the filter as follows. Date = “2021-06-25”, The expectation is that I would return all the rows that appear on this date, however filtering this way I have no return.
If I use the Date filter >=“2021-06-25”. it works, but it brings me back not only the lines corresponding to that date but all the other dates ahead.
Solved! Go to Solution.
Jul 07, 2021 01:02 PM
It’s a mystery why the >=
operator works while the =
operator doesn’t. Technically neither one should work because, as I said above, that formula comparing the Airtable date field—which stores the data in what’s called a datetime—against a string representation of a date.
If an exact match is what you really want, then what you could do is use a formula that formats the Airtable date similar to the formatting used in Landbot. Try this:
AND({company_}= '@company', DATETIME_FORMAT({data do agendamento}, 'MM/DD/YYYY') = '@date')
That will compare two similarly-formatted date strings, which should result in matches for some records.
Jul 02, 2021 01:48 PM
What is the right way to filter an exact date in the airtable?
Jul 06, 2021 07:14 AM
What’s this other system? Integromat? Zapier? Something else?
The reason that this doesn’t work is that you’re comparing the contents of a date field against a string. A string is any series of characters wrapped in quotes, and strings can’t be used to compare against dates. Once we know more about the other system that you’re using, we can offer specific guidance on how to correct this.
Jul 06, 2021 08:09 AM
@Justin_Barrett Im using a landbot chatbot. in this bot, the client types a date to search, and then his answer goes to an airtable block that queries that date and brings back the lines that have that date filled out. however if I use the function “=“ it doesn’t work. and if I use “>=“ it lists the date that the customer entered and all the others that follow.
Jul 06, 2021 08:45 AM
Could you please share a screenshot of your setup in the Landbot system, including where you have this condition entered?
Jul 06, 2021 09:01 AM
The formula I’m using in the screenshot is:
AND({company_}= ‘@company’, {data do agendamento} >= ‘@date’).
Jul 07, 2021 01:02 PM
It’s a mystery why the >=
operator works while the =
operator doesn’t. Technically neither one should work because, as I said above, that formula comparing the Airtable date field—which stores the data in what’s called a datetime—against a string representation of a date.
If an exact match is what you really want, then what you could do is use a formula that formats the Airtable date similar to the formatting used in Landbot. Try this:
AND({company_}= '@company', DATETIME_FORMAT({data do agendamento}, 'MM/DD/YYYY') = '@date')
That will compare two similarly-formatted date strings, which should result in matches for some records.
Jul 08, 2021 04:45 AM
thanks for the tip. I decided to do the reverse process. I created a new column in the airtable converting the date into string, so comparing string to string I can use the “=” symbol and now it’s working.