Possible to store a date with no time in timestamp field?

Database

Possible to store a date with no time in timestamp field?

I was wondering if it is possible, in a timestamp(0) or timestamp(6) to store only the date portion?

 

We may have an issue where some rows of source data only have a date at the day level while other records include the date + time as well. We prefer not to just have the time read 00:00:00 when the time is null as we would not be able to distinguish midnight from this defaulted 00:00:00 value. We could store a y/n flag in another column to indicate it was defaulted, but would need to do that for each of these columns that have this situation, and would complicate queries greatly. Just wondering if it's possible to not set a time on some records.

 

Thanks

1 REPLY
Highlighted
Teradata Employee

Re: Possible to store a date with no time in timestamp field?

No it is not possible. To do so would violate the domain of the data type.