1. Learn
  2. /
  3. Courses
  4. /
  5. Functions for Manipulating Data in SQL Server

Connected

Exercise

Changing the date format

Remember that SQL Server can interpret character strings that look like dates in a different way than you would expect. Depending on your settings, the string "29-04-2019" could be interpreted as the 29th of April, or an error can be thrown that the conversion to a date was not possible. In the first situation, SQL Server expects a day-month-year format, while in the second, it probably expects a month-day-year and the 29th month does not exist.

In this exercise, you will instruct SQL Server what kind of date format you want to use.

Instructions 1/4

undefined XP
  • 1

    Set the correct date format so that the variable @date1 is interpreted as a valid date.

  • 2

    Set the correct date format so that the variable @date1 is interpreted as a valid date.

  • 3

    Set the correct date format so that the variable @date1 is interpreted as a valid date.

  • 4

    Set the correct date format so that the variable @date1 is interpreted as a valid date.