Multiple choice technology

Find the functions that aptly convert a field named sys_date with Datetime data type to a string value.

  1. convert(varchar(10), sys_date,101)

  2. convert(varchar(11), sys_date)

  3. convert(varchar(10), sys_date)

  4. cast(sys_date as varchar(11))

Reveal answer Fill a bubble to check yourself
A,B,D Correct answer
Explanation

CONVERT function in SQL Server can convert datetime to varchar with optional style codes. CONVERT(varchar(10), sys_date, 101) converts to mm/dd/yyyy format (style 101). CONVERT(varchar(11), sys_date) converts without style (default format). CAST(sys_date as varchar(11)) is equivalent to CONVERT without style. Option C is incomplete - it needs a style parameter or length specification to be syntactically correct for this use case.