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

  • 0
  • 1
  • Question
  • Updated 7 months ago
  • Answered
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?
Photo of Elena Larrabee

Elena Larrabee

  • 736 Points 500 badge 2x thumb

Posted 7 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,296 Points 50k badge 2x thumb
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")
Photo of Elena Larrabee

Elena Larrabee

  • 736 Points 500 badge 2x thumb
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. 
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
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
Photo of Elena Larrabee

Elena Larrabee

  • 736 Points 500 badge 2x thumb
Makes sense, thanks!