
Answer-first summary for fast verification
Answer: DATETRUNC, DATEPART
The DATETRUNC function returns an input date truncated to a specified datepart, which can be used to get the first date of the month or other datepart. The DATEPART function extracts a specific part of a date, such as the month number. Therefore, to complete the T-SQL query that returns the desired columns from Sales.Orders, you should use these functions appropriately to handle date manipulation.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You are managing a Fabric warehouse that contains a table named Sales.Orders. The Sales.Orders table consists of several columns, as outlined below. Your task is to write a T-SQL query to retrieve the specified columns from Sales.Orders. Complete the code accordingly. To provide an answer, select the appropriate options in the provided answer area. NOTE: Each correct selection is worth one point. The DATETRUNC function truncates an input date to a specified datepart, returning the first date of the month, with the datepart representing the month number.
A
DATEFROMPARTS
B
DATETRUNC
C
DATEPART
D
WEEKDAY