October 26, 2017 at 8:27 pm
Comments posted to this topic are about the item Fun with Dates
October 27, 2017 at 12:44 am
Nice little puzzle to end the week on, thanks Steve.
...
October 27, 2017 at 2:02 am
But why:
SELECT IsNull = 'Isnull'
?
October 27, 2017 at 6:40 am
Nice question to end the week on, thanks Steve
RoNoS - Friday, October 27, 2017 2:02 AMBut why:SELECT IsNull = 'Isnull'?
This happens when implicit conversion takes place (in this case DATE to DATETIME)
try this:DECLARE @MyDate DATE, @MyDateTime DATETIME = GETDATE();
SET @MyDate = @MyDateTime;
IF @MyDate = @MyDateTime
BEGIN
SELECT "The variables match"
END
ELSE
BEGIN
SELECT "No way these variables match"
END
____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
October 27, 2017 at 8:16 am
Actually, Ii think the answer should have been "The parameter @dt is the wrong data type"
Michael L John
If you assassinate a DBA, would you pull a trigger?
To properly post on a forum:
http://www.sqlservercentral.com/articles/61537/
October 29, 2017 at 5:09 pm
RoNoS - Friday, October 27, 2017 2:02 AMBut why:SELECT IsNull = 'Isnull'?
Heh... I can't know for sure because I can't read Steve's mind but I'm thinking that it was a huge hint. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply