1 2 Previous Next 19 Replies Latest reply on Dec 7, 2011 11:21 AM by Makena05

# Date countdown from 30

### Title

Date countdown from 30

### Post

Hello,

I'm trying to figure out how to have a field cowntdown from 30 days based on a specific date that's entered in another field.  In other words, when someone creates a new record and the date is recorded, I want to have a field that counts down the days from 30 because the record needs to be completed within 30 days.  Anyone know how I can go about doing this?

What would even be really cool is if the database could send an email out when the countdown is a 5 days left...but I'm probably getting in way over my head for that to happen.

• ###### 1. Re: Date countdown from 30

You could set up a field for Due date and define it to be auto entered as creation date + 30.  The have a days remaining field that is Due date - Get(current date) to show your count down.  To set up the email you would just need a script to run through the records and check for days remaining = 5, if so send the email.

• ###### 2. Re: Date countdown from 30

Thank you for the information Mark.  I tried this out by creating a new field to hold the current date + 30.  However, I'm getting the warning that the "calculation result must be Date".  Right now my calculation is:  Creation date + 30

When I have this formula, it gives me the date of 0/0/0000.  Do you know how I can make sure the "30" goes on days and not years or months?

• ###### 3. Re: Date countdown from 30

Use Get ( CurrentDate ) + 30

Date fields are really number fields that record the number of days from 12/31/0000 to the date in question. Thus, when you use it in a calculation with a number like 30, the 30 represents 30 days.

• ###### 4. Re: Date countdown from 30

Thanks...this is working for the most part.  Now my only struggle is that "number of days until it's due" is not counting down automatically.  In other words, if I create a record today, the number of days until due is 30.  When I look at the same number the next day (I changed the date on my computer), it doesn't show 29 like it should...it stays at 30.  Any ideas on this?

• ###### 5. Re: Date countdown from 30

Open the field's definition and click the storage options button. Select unstored.

• ###### 6. Re: Date countdown from 30

Sorry, I can't seem to find the "unstored" option.  I have attached a screenshot of the storage tab for the "days until due" tab.  I appreciate your patience with me!

• ###### 7. Re: Date countdown from 30

Go to the window where you defined the calculation.  There is a storage options button there

• ###### 8. Re: Date countdown from 30

This cannot be an auto-entered calculation. In order for it to update with the passage of time, it should be a field of type calculation. You'll find the "storage options" button inside the specify calculation dialog. (It's not there when you specify an auto-enter calculation, which is why I posted it this way, to make sure you were using a calculation field, not a data field with an auto-entered calculation.)

• ###### 9. Re: Date countdown from 30

Sorry guys...I'm still having trouble finding this.  Here is another screenshot.  Is this the window you are referring to?

• ###### 10. Re: Date countdown from 30

as Phil said, go back to the field definition and change its type to calculation, then you will see a storage options button above the OK and Cancel buttons

• ###### 11. Re: Date countdown from 30

Perfect...changed to calculation and found the storage option.  It's working...thank you both for your help!

• ###### 12. Re: Date countdown from 30

Open manage | database | fields and click this field. Then select "calculation" from the type drop down in the lower right corner. Click change. Double click the field and you'll find your storage options button.

• ###### 13. Re: Date countdown from 30

Now you can write a script that performs a find for Days until due = 5,  then loops through each found record and sends the emails.

• ###### 14. Re: Date countdown from 30

Wow, that would really save a lot of time.  I think I know how to script the email with 5 days left with a logical function.  The only thing I don't know is where do I create that script?  The scripts I have created in the past were in "Manage scripts" and could only be triggered by clicking a specific button in the record.  Is there a way to create a script like this and have it run automitically (without user intervention) at like 8:00 in the morning?  If so, where would I create the script?

1 2 Previous Next