WHERE date_created >= ?"; "";""; get (currentDate)-30)
I don't have error with
date_created >= CURRENT_DATE - 30
if the field type is date or timestamp.
If you contain today in 30, it would be -29.
Hmmm given that we want "within 30 days" might that be 30 days in the future or earlier?
if so, we need to add 30 to today's date instead of subtracting And use <= instead of >=.
if you have a field named INTERVAL 30 DAY and want to use it in the query you have to escape it like this (because it contains spaces in the field name) :
\"INTERVAL 30 DAY\"
I don't see where FMP supports the INTERVAL 30 DAY syntax. I just looked at the FMP SQL reference for 14 and, of course could have missed it.
INTERVAL 30 DAY is MySQL syntax as I've always used it.
FMP lists "INTERVAL" as a reserved keyword, but I find no examples where it's ever used.
(Note: To save lots of frustration, try an external SQL tool to connect to FileMaker, like RazorSQL. It could save you many hours of head-banging.)
HOPE THIS HELPS.
INTERVAL x DAY is not a function in FileMaker's ExecuteSQL().
If you have FileMaker Advanced, then these instructions may assist you in getting the error:
If only FMP (not Advanced), you may also be able to place
around the ExecuteSQL() to return the error number, if any.