Multiple choice technology

Find the function to get the name of a particular day in a week.

  1. datename(week,getdate())

  2. datename(dw,getdate())

  3. datename(wk,date())

  4. datename(day,getdate())

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

The DATENAME function in SQL Server returns the name of a specified date part as a string. To get the day name (like 'Monday', 'Tuesday'), use DATENAME(dw, GETDATE()) where 'dw' stands for day of week (weekday). Option B is correct. Option A uses 'week' which returns week number, not day name. Option D uses 'day' which returns the day number (1-31).