INF: BCPing in Just the Date of Datetime Column

ID Number: Q67659

1.10 1.11 4.20

OS/2

Summary:

The following information discusses what happens when just the date

is BCPed into a datetime field.

It is possible to BCP just the date into a datetime field. The storage

size will be the same as if you had both the date and time. For a

datetime column, this is 4 bytes for the number of days since January

1, 1900, and 4 bytes for the number of milliseconds after midnight on

that day. If you select from SQL Server what you have input with BCP,

you will see the time "12:00AM" on the end of each date, because the

number of milliseconds after midnight is 0 (zero).

To display just the date portion of a datetime field, use the style

parameter of the convert() function. For example:

select convert(char(12),getdate(),3)

Additional reference words: 1.10 1.11 4.20