SQL Server 2008 introduces new date and time data types: • DATE – a date only type • TIME – a time only type • DATETIMEOFFSET – a time zone aware datetime type.
The new data types enable applications to have separate data and time types while providing large data ranges or user defined precision for time values.
We can use DATE or TIME data types in a table.
Create Table VideoLiberary ( ID Numeric, Title Varchar(100), Producer Varchar(100), PublishDate date NULL, VideoLength time NULL )
We can also use the OFFSET to change the Time Zone.
GMT
Select Title, Producer, VideoLength from VideoLiberary Where PublishDat between '2007-08-29 00:00 -05:30' and '2007-08-30 00:00 -05:30'
(IST Subtracting 5:30 as IST is 5:30 hr ahead from GMT)
Select Title, Producer, VideoLength from VideoLiberary Where PublishDat between '2007-08-29 00:00 -05:30' and '2007-08-30 00:00 -05:30'
|
No responses found. Be the first to respond and make money from revenue sharing program.
|