PrepAway - Latest Free Exam Questions & Answers

You need to display dates and times in several international formats

You develop a database for a travel application. You need to design tables and other database objects.You
create a view that displays the dates and times of the airline schedules on a report. You need to display dates
and times in several international formats. What should you do?

PrepAway - Latest Free Exam Questions & Answers

A.
Use the CAST function.

B.
Use the DATE data type.

C.
Use the FORMAT function.

D.
Use an appropriate collation.

E.
Use a user-defined table type.

F.
Use the VARBINARY data type.

G.
Use the DATETIME data type.

H.
Use the DATETIME2 data type.

I.
Use the DATETIMEOFFSET data type.

J.
Use the TODATETIMEOFFSET function.

Explanation:
Reference: http://msdn.microsoft.com/en-us/library/hh213505.aspx

7 Comments on “You need to display dates and times in several international formats

  1. Shujie says:

    Use the FORMAT function for locale-aware formatting of date/time and number values as strings.
    Examples:

    DECLARE @d DATETIME = ’10/01/2011′;
    SELECT FORMAT ( @d, ‘d’, ‘en-US’ ) AS ‘US English Result’
    ,FORMAT ( @d, ‘d’, ‘en-gb’ ) AS ‘Great Britain English Result’
    ,FORMAT ( @d, ‘d’, ‘de-de’ ) AS ‘German Result’
    ,FORMAT ( @d, ‘d’, ‘zh-cn’ ) AS ‘Simplified Chinese (PRC) Result’;

    SELECT FORMAT ( @d, ‘D’, ‘en-US’ ) AS ‘US English Result’
    ,FORMAT ( @d, ‘D’, ‘en-gb’ ) AS ‘Great Britain English Result’
    ,FORMAT ( @d, ‘D’, ‘de-de’ ) AS ‘German Result’
    ,FORMAT ( @d, ‘D’, ‘zh-cn’ ) AS ‘Chinese (Simplified PRC) Result’;




    0



    0

Leave a Reply