DoDoTwin Posted November 12, 2016 Report Share Posted November 12, 2016 Hello, I have a date field (Date1). I would like to compute difference between Date1 and Today() in DAYS and to store the result (DiffDate1) If Date1<Today() Then 0 Else DiffDate1 = Date1-Today() Every day, at midnight, the calculation needs to be recomputed. Caspio provides the following example that doesn't work: Datediff(day,GetUTCDate(),[@field:Date1]) Quote Link to comment Share on other sites More sharing options...
0 MayMusic Posted November 16, 2016 Report Share Posted November 16, 2016 The value cannot be calculated and saved to the table automatically. You can save that upon update. To automate this and run the code every night you need to have a developer from Caspio to custom code it Quote Link to comment Share on other sites More sharing options...
0 Aether Posted January 15, 2019 Report Share Posted January 15, 2019 Hello @DoDoTwin, I would like to infor you that you can use a "Calculated Field" in your Reports DataPages that can get the difference of your Date field and the current date. Check this documentation, for more information: https://howto.caspio.com/faq/reports-datapages/calculated-fields-and-datediff-function/ I hope this helps. ~WatashiJin~ Quote Link to comment Share on other sites More sharing options...
0 ManokNaPula Posted January 28, 2019 Report Share Posted January 28, 2019 Hi there! I think what you need to do here is to setup a Task that will run every day. This is now possible without the use of custom coding. Setting up the Task would be like this: And the logic would be something like this: You can check out this link for more reference about Scheduled Tasks: https://howto.caspio.com/tasks/ Have a great day! Quote Link to comment Share on other sites More sharing options...
Question
DoDoTwin
Hello,
I have a date field (Date1). I would like to compute difference between Date1 and Today() in DAYS and to store the result (DiffDate1)
If Date1<Today() Then 0
Else DiffDate1 = Date1-Today()
Every day, at midnight, the calculation needs to be recomputed.
Caspio provides the following example that doesn't work: Datediff(day,GetUTCDate(),[@field:Date1])
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
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.