Oh good grief. Whenever I hear people talking about this subject like this, it drives me absolutely *nuts*. I want to get out a hammer and start breaking fingers.
The premise of the article is utterly wrong. This is not a nuance, it is flat NORMAL. It is not something uncommon, it happens *everywhere*.
It is a fundamental lack of comprehension of the datetime datatype. Thinking like this has caused more bugs over the last 70 years than the NULL. It is thinking like this that gave the world Y2K.
Please get this through your thick heads--
EVERY datetime has a date. EVERY datetime has a time.
There are no exceptions to this, none.
When you get date data in, immediately store it in a datetime and *leave it there*. Do not allow users to enter invalid dates, use a calendar control.
If you convert a datetime to text for something other than display, you are doing something WRONG. By WRONG, I mean completely bat-droppings crazy.
alter function dbo.udfTimeOnly ( @datetimevar datetime )
declare @bitvar bit;
IF cast(@datetimevar as date) = cast(0 as datetime)
--date is zero date--assume invalid
set @bitvar = 1;
set @bitvar = 0;
As a another ranting aside, to show foobar data, I highly advise using something other than three exes, you know, these things: x.