Multiple choice technology databases

What is the result of the following statement: select cast(floor(cast(@MyDateTime as float)) as datetime)

  1. Next Sunday relative to @MyDateTime

  2. Only date part of @MyDateTime

  3. Only time part of @MyDateTime

  4. Doesn't work because you cannot cast float to datetime

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In SQL Server, casting a datetime to a float represents the date as the number of days since a base date (1900-01-01). Applying floor() removes the decimal part (which represents the time portion), and casting it back to datetime returns the original date at midnight (00:00:00.000), stripping the time.