April 3, 2017 at 9:13 pm
Comments posted to this topic are about the item Just the time, please
April 4, 2017 at 9:18 am
Thanks for this question Steve. I repeated the conversion time to datetime2...:ermm:
For the result to 1900-01-01 10:00:00.000 should be in the code specified DECLARE @t DATETIME2(3) = '10:00 am';
Without running the code in SSMS can be found the right answer in the Dosc MS time (Transact-SQL), or maybe even better in TECHNET Using Date and Time Data
April 4, 2017 at 9:36 am
George Vobr - Tuesday, April 4, 2017 9:18 AMThanks for this question Steve. I repeated the conversion time to datetime2...:ermm:
For the result to 1900-01-01 10:00:00.000 should be in the code specified DECLARE @t DATETIME2(3) = '10:00 am';
Without running the code in SSMS can be found the right answer in the Dosc MS time (Transact-SQL), or maybe even better in TECHNET Using Date and Time Data
The value is the same.
April 4, 2017 at 9:40 am
Really, really trivial. Thanks, Steve!
April 4, 2017 at 11:04 pm
Actually (and without giving up the correct answer here), none of the answers are correct because the correct answer doesn't have enough zeroes to the right of the decimal point. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
April 5, 2017 at 12:34 am
Nice, easy one, thanks Steve...
____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
April 5, 2017 at 6:52 am
Luis Cazares - Tuesday, April 4, 2017 9:36 AMGeorge Vobr - Tuesday, April 4, 2017 9:18 AMThanks for this question Steve. I repeated the conversion time to datetime2...:ermm:
For the result to 1900-01-01 10:00:00.000 should be in the code specified DECLARE @t DATETIME2(3) = '10:00 am';
Without running the code in SSMS can be found the right answer in the Dosc MS time (Transact-SQL), or maybe even better in TECHNET Using Date and Time DataThe value is the same.
Hi Luis,
it's not about value, but display the result. Indeed, the Column length (bytes) of the variable @t with a precision of 7 is different than with precision 3.
April 6, 2017 at 2:53 am
I changed the DECLARE. You're right, the precision is different with the default (7)
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply