Switching to next year
Hello everyone, I hope you're all well! I don't know if this question is already asked, but here's the deal: I have a table containing 2 fields-1 text field and 1 date field. It shows the dates of the "name day" for each name. I would like this table to refresh every new year, so if a name has its name day on November 11, 2022, I want to be able with a single action replace the date to November 11, 2023 and so on! is there a way to do that?
Thank you so much in advance.
Best regards
9 replies
-
Also, one more thing: I want these 2 fields to be imported in another table, where I already put a field (name) that I choose from the 1st field, but I want to auto insert the date field on the same record! Any suggestions on that??
-
Scratch the 2nd question, I found out how to do that! I just need help with the year replacement from the 1st question!
Thanks you guys!
-
The formula update the datefield is
if today() > datefield then datefield := date(year(today())+1, month(datefield), day(datefield)) end;
-
You are correct, if you put it in the Trigger after open: then it needs to know the table and records, so change the code to something like this
for a in select tablename where today() > datefield do a.datefield := date(year(today())+1, month(a.datefield), day(a.datefield)) end;
Regards John
Content aside
- 2 yrs agoLast active
- 9Replies
- 84Views
-
4
Following