On Transact SQL language the datetime is part of date and time data types and define a date that is combined with a time of day with fractional seconds.
Datetime syntax:
datetime
Property | Value |
---|---|
Range | January 1, 1753, through December 31, 9999 |
Length | 19 minimum - 23 maximum |
Storage size | 8 bytes |
Calendar | Gregorian |
Datetime example:
USE model;
GO
DECLARE @date date= '08-21-14';
DECLARE @datetime datetime = @date;
SELECT @datetime AS 'Datetime', @date AS 'Date';
GO
Datetime | Date |
---|---|
2014-08-21 00:00:00.000 | 2014-08-21 |