Jonathan AC Roberts wrote:
DECLARE @DateString nvarchar(100)='Wed Jun 29 15:57:45 2019'
I've always been astounded by the implicit conversions of strings to DateTime that SQL Server handles correctly. It seriously outstrips the formatting available through CONVERT and people seem to thing that's all it can handle for string conversions.
I have to admit that I've not seen this format before but, like you, I would have tried it anyway and would have, once again, been astounded by its implicit conversion capabilities.
Nicely done, Jonathan.
is pronounced "ree-bar
" and is a "Modenism
" for R
First step towards the paradigm shift of writing Set Based code:
________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
"Change is inevitable... change for the better is not".
"If "pre-optimization" is the root of all evil, then what does the resulting no optimization lead to?"
How to post code problems
How to Post Performance Problems
Create a Tally Function (fnTally)