I want to create a calculated field within a table. I’ve tried to use a query to do this but it doesn’t work. I think I’m using the wrong function to get the date / year from the date. The error message suggests I read the user manual but I honestly do not know where to find the manual
If you’re interested in creating a calculated field, I recommend checking out this blog: Calculating Field Values In Five | Five.
It can be done in SQL as follows:
YEAR(NOW()) - YEAR(DOB) - 5 AS SchoolYear,
The issue with your SQL is the use of GETDATE() which isn’t available in MySQL. I have replaced this with NOW()
I have set up a sample application for you with the table, a standard form, the above query, a data view and a form using the query as the data source which I am happy to share with you. Please let me know which version of Five you are running which you can get by clicking on the profile button in the top right hand corner and then clicking on the Five logo.