Discussions

Expand all | Collapse all

Is there a way to leave the ""time"" portion of a Date/Time field blank?

  • 1.  Is there a way to leave the ""time"" portion of a Date/Time field blank?

    Posted 04-02-2018 21:15
    I'm trying to create a formula that says "if the time portion of a date/time field is blank, then do this, if not blank, do this" but I'm noticing that the "time" portion of a date/time field is never blank since it defaults to 12am if you don't input a value... Sometimes there are defined times for this field and other times there aren't necessarily. Is there a way to just leave it as a blank value and not have it default to midnight?


  • 2.  RE: Is there a way to leave the ""time"" portion of a Date/Time field blank?

    Posted 04-02-2018 21:19
    A date time field will always have a date and time.

    But you can test for midnight.

    IF(ToTimeOfDay([my date/time field]) = ToTimeOfDay("12:00 am"), "it is midnight")


  • 3.  RE: Is there a way to leave the ""time"" portion of a Date/Time field blank?

    Posted 04-02-2018 21:23
    Ah, I see. Shoot, I thought about doing that, but occasionally the time actually will be midnight and I won't want the formula to treat it as a blank value. 


  • 4.  RE: Is there a way to leave the ""time"" portion of a Date/Time field blank?

    Posted 04-02-2018 21:27
    The field type of 'Date/Time' must have a time, thus even if you leave it blank the time is defaulted.

    It is usually best to have those fields separated on the data entry portion, and then have them combined later if needed.

    If its possible for you, I'd recommend making a 'date' field and a 'time of day' field.  Then you can easily create the formula field to default to what you need.


    Generally speaking its always easier to combine, then to separate.

    i.e. First Name & Last Name as two separate fields, can always be combined to one, but its harder to separate full name into its components later.



    Matthew Neil - Product Specialistmneil@mcftech.com Phone: 440-201-6050 ext. 476" width="300px">


  • 5.  RE: Is there a way to leave the ""time"" portion of a Date/Time field blank?

    Posted 04-02-2018 21:30
    Makes sense, thanks!