What is the correct use of the Trunc command on a date?
Reveal answer
Fill a bubble to check yourself
What is the correct use of the Trunc command on a date?
TRUNC=To_Date('09-Jan-02,DD-MON-YY,'YEAR',"Date" from Dual;
Select TRUNC(To_Date('09-Jan-02,DD-MON-YY,YEAR')) "DATE" from Dual;
Date =TRUNC(To_DATE('09-Jan-02','DD-MON-YY'),'YEAR'),'YEAR)"DATE: from DUAL;
SELECT TRUNC(TO_DATE('12-Feb-99','DD-MON-YY'), 'YEAR') "Date " FROM DUAL;
Option D demonstrates the correct TRUNC function syntax with proper date formatting and string quoting. TRUNC accepts a date value and a format string, returning the date truncated to the specified precision level - in this case, 'YEAR' truncates to January 1st of that year. Options A, B, and C contain syntax errors including missing closing parentheses, incorrect quote usage, malformed function calls, and improper string literal formatting. The correct syntax requires TRUNC(date_value, format_string) with proper parentheses and string quotes.