Forum Discussion

ElenaLarrabee1's avatar
ElenaLarrabee1
Qrew Captain
7 years ago

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

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?

4 Replies

  • 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")
  • 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. 
  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    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 Specialist