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.
Thursday, February 11, 2010
Format date with CONVERT()
at 6:02 AM
Labels: SQL Server, SQL Server Test, SQL Server Tip
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment