Jump to content
  • 0

Syntax error with using DateDiff in calculated field in table



Hello Community,

I´m new to Caspio and my try, to use a calculated field in a table ends with an error (see Screenhot here: http://prntscr.com/cxgbw8) in the formula:

Invalid formular: Incorrect syntax near PERSISTED

I´ve used this formular DateDiff(year, [@field:P_DOB], GetUTCDate() as it is shown in the help section (http://howto.caspio.com/faq/reports-datapages/calculated-fields-and-datediff-function/).

Any ideas about my wrong usage?

Thanks for your comments! :)

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
7 hours ago, SGProject said:

Thank you very much for your answer, Mathilda, but do you have a recommendation, how a field could be updated with such a DateDiff-value?

You may use this kind of formula only in calculated field on report datapage. So when you open a report, age will be calculated dynamically and your data will be always up-to-date. It's very important, especially when you need to calculate someone's age :) 

However if you need to store value of calculated field in the table, you may use the solution described here

Link to comment
Share on other sites

  • 0

Hi @SGProject,


Using GetDateUTC is not allowed in formula field. This year Caspio released new features. One of the new features is Calculated Values in the Submission form. The Calculated Value form element generates dynamic calculations that automatically update as users interact with your form. The formula you are using is valid using this. 


You can find more information regarding Calculated Values through this link: https://howto.caspio.com/datapages/datapage-components/calculated-values/




Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...