The concept of “forever” or “until further notice” is an unconditional sentence.
Actually, the theory of relativity says that there is no such thing as null, so you must have any table divided into two parts: one part with rows for which the end date / time of the end is known, and another for the row for which end time is not yet known.
But (for example, with zero) dividing the tables into two parts will also cause a mess in your query. Views may to some extent correspond to read-only details, but updates (or the INSTEAD OF record on your view) will be tough no matter what can affect performance negatively no matter what it is).
Having a zero value means that “end time is not yet known” will make updating “simpler”, but read requests become messy with all the CASE ... or COALESCE ... constructs you need.
Using the theoretically correct solution mentioned by dportas gets messy whenever you want to “extract” a DATE from a DATETIME. If the DATETIME value at hand is “the end (representable) time (billions of years from the moment you say)”, then this is not just the case when you call the DATE extractor function from that DATETIME value, because you also want DATE extractor created the "end of representable DATE" for your case.
In addition, you probably do not want to display the “missing end of time” as the value 9999-12-31 in your user interface. Therefore, if you use the “real value” of the end of time in your database, you are faced with a little work, seeing that this value will not be displayed anywhere in your user interface.
Sorry for not being able to say that there is a way to stay away from all the riots. The only choice you really have is the mess you are in.
source share