Programming in MS SQL Server 2012 |
Date Time Data TypeDatetime data type is used to stores date or time or datetime information. SQL Server allows traditional and non-traditional date format. The following example describes a typical DateTime Data Type. --
Example 77 -- DECLARE @ProductExpiryDate
DateTime,
@ServerSystemDate
DateTime SET @ProductExpiryDate
= '12/31/2005' SET @ServerSystemDate
= GETDATE() SELECT 'Product Expiry
Date' = @ProductExpiryDate,
'Server System
Date' = @ServerSystemDate,
'Date Different
Data' = DATEDIFF(Day, @ProductExpiryDate, @ServerSystemDate) |
* * * * *