Default Date Field

Viewing 6 reply threads
  • Author
    Posts
  • February 22, 2023 at 7:44 PM #49002

    Jennie Elliott
    Participant

    I have a seed starting DB and when I add a new record I want the Frost Free Date to automatically be a pre programmed date of 5/6/23 as I have other fields that calculate dates based on this date.

    It will eliminate me having to manually pick this date on this form and a huge time save.

    How can I accomplish this?

    February 22, 2023 at 10:03 PM #49006

    Brendan
    Keymaster

    Hi Jennie,

    hmm.. that’s a good question. Right now you can only set the current date on a Date field as a default date. But what you could do is add a Calculation field that returns a specific date. Then your other Calculation fields can use that Calculation field’s result.

    You would use the Calculation field formula:

    DATEVALUE("2017-12-31"; "yyyy-MM-dd")

    Set the Result Type of your Calculation field to Date.

    Thanks,

    Brendan

    • This reply was modified 2 years, 1 month ago by Brendan.
    February 23, 2023 at 6:40 PM #49016

    Jennie Elliott
    Participant

    That worked for that field. Thanks! But here is what I ultimately want to see on this screen:

    I pick my crop that I want to start from seed from another form with that data. I input what is recommended as weeks before Frost Free Date, (i.e. 10-12 Weeks) and then I want it to give me the start dates while giving me NULL (blank) fields if outside that variable.

    I eventually am going to print this to take out to my greenhouse.

    Does that make sense?

    I attached a screenshot.

    Thanks!

    Attachments:
    You must be logged in to view attached files.
    February 23, 2023 at 6:48 PM #49018

    Jennie Elliott
    Participant

    This is what I have used in Excel with the formula of =$Q$2-C2*7 (FrostFreeDate-12*7) to give me the date. If that helps with how I want this to work.

    Attachments:
    You must be logged in to view attached files.
    February 23, 2023 at 8:30 PM #49022

    Daniel Leu
    Participant

    I would just use a text field for your Frost Free Date field. There you can set a default value and you can overwrite it if desired. It is important that you use the proper date format since the text field doesn’t do any checking!

    Then the calculation would be something like this:

    DATEADD(DATEVALUE([Frost Free Date]; "MM/dd/yy"); 0;0; -[Growth period in weeks];0;0;0;0)

    DATEVALUE() translates your text field into a date format. DATEADD() adds (or subtracts) the given number of weeks. The result type for the calculation field needs to be set to Date.

    Attached is my test form.

    Attachments:
    You must be logged in to view attached files.
    February 24, 2023 at 8:24 AM #49024

    Jennie Elliott
    Participant

    Thanks so much! That is exactly what I needed.

    February 24, 2023 at 11:14 AM #49025

    Daniel Leu
    Participant

    Great that this works for you! Good luck with your seed database!

Viewing 6 reply threads

You must be logged in to reply to this topic.