Getting GAIA_IQ04 when using TODAY() in a query on a Calculated field. Can functions not be used with Calculated fields?
Current Situation
My app has a Date field start_date and a Calculated field due_date with the formula start_date + 14 * 24 * 60 * 60 and its display format set to Date. On the record list it shows correctly as a date (e.g. 2026-11-12).
I’m building a JS customization that runs on the record list page and fetches all records whose due_date has already passed, so I can highlight them.
I also tried due_date < FROM_TODAY(0, DAYS) and due_date < NOW(), and got the same error.
If I hard-code a date, it works:
query: 'due_date < "2026-10-29" order by $id asc limit 500'
Error Message
{
"code": "GAIA_IQ04",
"id": "NNxKi5kzZLyakpqCyIVf",
"message": "The function TODAY is not available."
}
Desired Outcome / Expected Behavior
I due_date < TODAY() to work the same way it does on a regular Date field, since the Calculated field is formatted as a date. Is there a different way to do this?
The GAIA_IQ04 error occurs because query functions such as TODAY() are not supported for Calculated fields, even when their display format is set to Date.
Since Kintone stores calculated date values as Unix timestamps (in seconds), you can work around this by generating today's date in JavaScript, converting it to a Unix timestamp, and using that numeric value in your query.
Since due_date is just start_date + 14 days, you can avoid calculated-field query functions entirely by filtering the regular Date field: query: start_date < FROM_TODAY(-14, DAYS) order by $id asc limit 500. That matches due_date < today (a record due today is not returned) and lets Kintone handle timezone/date boundaries. I’d also be cautious with the timestamp approach: parsing the local date as T00:00:00Z can shift the cutoff depending on the user/app timezone.