DateTime Format

ActiveX Data Objects (ADO), OLE DB, and Open Database Connectivity (ODBC) applications should use the following escape clauses when specifying dates for input to INSERT and UPDATE statements. Use the 24-hour time format; do not use A.M or P.M. to indicate morning or evening:

  • {ts 'YYYY-MM-DD [HH:MM:SS.FFF]'}, for example, {ts '2000-10-31 23:59:59.999'}
  • {d 'YYYY-MM-DD'}, for example, {d '2000-10-31'}
  • {t 'HH:MM:SS'} for example, {t '23:59:59'}

For further information, see Writing International Transact-SQL Statements in SQL Books Online.

On import, if one member of a multi-valued DateTime member is invalid, none of the DateTime members are imported.

Copyright © 2005 Microsoft Corporation.
All rights reserved.