Thursday, February 11, 2010

Format date with CONVERT()

Do you remember the CONVERT function for date/time value?
Which of the following scripts return the date value as YYYY/MM/DD?

A. SELECT CONVERT(VARCHAR(10), GETDATE(), 101)
B. SELECT CONVERT(VARCHAR(10), GETDATE(), 102)
C. SELECT CONVERT(VARCHAR(10), GETDATE(), 111)
D. SELECT CONVERT(VARCHAR(10), GETDATE(), 112)

Answer:[C]
Highlight to find out the answer.

No comments:

Post a Comment

Oracle Query