calculate how many DAYS have passed since a date in a lookup field
Posted: 2019-11-21 19:25
Hi!
I have a table partecipazione_evento_pubblico.
In the table there are a field data_evento and a field giorni_da_evento.
The data_evento field is a lookup field that points to the date fielde data_appuntamento of the table appuntamenti.
Both tables have the primary key name field: pri_key
I would like the giorni_da_evento field to automatically calculate how many DAYS have passed since the date indicated in the data_appuntamenti field.
In calculated field area in appgini i have set this code but it don't work:
SELECT(
DATEDIFF(`data_evento`, NOW())
FROM 'partecipazione_evento_pubblico'
WHERE `pri_key` = '%ID%'
Another question: how do I make the result of the calculated table field update by itself without having to open every single record?
Thanks!
I have a table partecipazione_evento_pubblico.
In the table there are a field data_evento and a field giorni_da_evento.
The data_evento field is a lookup field that points to the date fielde data_appuntamento of the table appuntamenti.
Both tables have the primary key name field: pri_key
I would like the giorni_da_evento field to automatically calculate how many DAYS have passed since the date indicated in the data_appuntamenti field.
In calculated field area in appgini i have set this code but it don't work:
SELECT(
DATEDIFF(`data_evento`, NOW())
FROM 'partecipazione_evento_pubblico'
WHERE `pri_key` = '%ID%'
Another question: how do I make the result of the calculated table field update by itself without having to open every single record?
Thanks!