January 9, 2020 at 12:00 am
Comments posted to this topic are about the item More Delays
January 9, 2020 at 6:44 am
There are actually 2 different, but related, errors:
The date is included in the literal;
the time contains a letter "p" that is not recognised;
therefore, answers 2 and 3 are equally valid
January 9, 2020 at 12:51 pm
From the Microsoft docs link.
Dates can't be specified, so the date part of the datetime value isn't allowed. time_to_execute is formatted as hh:mm[[:ss].mss] and can optionally include the date of 1900-01-01.
Now I just find this fun. Can Microsoft please make up their mind 🙂
January 9, 2020 at 2:11 pm
There are actually 2 different, but related, errors:
The date is included in the literal;
the time contains a letter "p" that is not recognised;
therefore, answers 2 and 3 are equally valid
Agreed. There are two right answers. Sadly I chose the wrong correct answer.
Good question Steve. I have been enjoying the questions on lessor used topics over the last couple of months.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
January 9, 2020 at 2:42 pm
Totally agree that there are two correct answers and sadly I choose the wrong correct answer, as well.
January 10, 2020 at 9:55 am
Glad I wasn't online to answer this one yesterday.
thanks for the question, Steve, had to think a bit before answering...
____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
January 16, 2020 at 11:54 pm
The question is "What happens when I run this code?". The error I get is
Msg 148, Level 15, State 1, Line 5
Incorrect time syntax in time string '2020-01-10 1:13.' used with WAITFOR.
So the only correct answer is "An error occurs because the time is formatted wrong".
Yes, it would get the date error if it didn't have a problem with the time, but that not what happens when I run the code.
January 17, 2020 at 4:21 pm
I agree with the others on this, especially Scott. It reports a problem with the time being formatted incorrectly whether or not it includes the date or not. But, going by the question, there are two correct answers as to what the cause of the error is. Heh... this is why I hate tests.
If this question were actually on a qualification, university, or interview test, I'd go to the wall for my handwritten answer of "Both B and C" because you actually need to fix both for it to not produce an invalid time error.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply