Skip to main content

Invalid syntax for field formula: IF((new Date(TODAY())>=new Date(‘01/01/2017’) && new Date(TODAY())<=new Date(‘03/31/2017’)),“Q1”,IF((new Date(TODAY())>=new Date(‘04/01/2017’) && new Date(TODAY())<=new Date(‘06/30/2017’)),“Q2”,IF((new Date(TODAY())>=new Date(‘07/01/2017’) && new Date(TODAY())<=new Date(‘09/30/2017’)),“Q3”,“Q4”))). SyntaxError: Expected “(” or x0C


x0B    -      ] but "D" found.

Wild guess is that it is the spaces between “new” and “Date”. Try making it one word and see if that helps.


Raghu -

This formula field is using javascript syntax instead of the Skuid formula syntax.  Use the following syntax instead:


IF((MONTH(TODAY())==1 || MONTH(TODAY())==2 || MONTH(TODAY())==3), "Q1", IF((MONTH(TODAY())==4 || MONTH(TODAY())==5 || MONTH(TODAY())==6), "Q2", IF((MONTH(TODAY())==7 || MONTH(TODAY())==8 || MONTH(TODAY())==9), "Q3","Q4")))

You can reference this article for more information on the Skuid formulas that are accepted in the UI-Only fields:
https://docs.skuid.com/latest/en/skuid/models/ui-only-models-fields.html

Thanks!
Christine


Reply