Udostępnij za pośrednictwem


Alphabetic Date Format

In Microsoft SQL Server 2005 you can specify date data with a month specified as the full month name, for example, April, or the month abbreviation, for example, Apr, given in the current language; commas are optional and capitalization is ignored.

Here are some guidelines for the use of alphabetic date formats:

  • Enclose the date and time data in single quotation marks (').

  • These are the valid alphabetic formats for SQL Server date data (characters enclosed in brackets are optional):

    Apr[il] [15][,] 1996 
    Apr[il] 15[,] [19]96 
    Apr[il] 1996 [15]
    
    [15] Apr[il][,] 1996 
    15 Apr[il][,][19]96 
    15 [19]96 apr[il]
    [15] 1996 apr[il]
    
    1996 APR[IL] [15]
    1996 [15] APR[IL]
    
  • If you specify only the last two digits of the year, values less than the last two digits of the value of the two digit year cutoff configuration option are in the same century as the cutoff year. Values greater than or equal to the value of this option are in the century that precedes the cutoff year. For example, if two digit year cutoff is 2050 (default), 25 is interpreted as 2025 and 50 is interpreted as 1950. To avoid ambiguity, use four-digit years.

  • If the day is missing, the first day of the month is supplied.

  • The SET DATEFORMAT session setting is not applied when you specify the month in alphabetic form.

See Also

Concepts

Using Date and Time Data

Other Resources

Date and Time (Transact-SQL)
LIKE (Transact-SQL)
SET DATEFORMAT (Transact-SQL)

Help and Information

Getting SQL Server 2005 Assistance