C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Date and Time data types in SQL Server 2008


Posted Date: 18 Aug 2008    Resource Type: Articles    Category: Databases

Posted By: Kundan Kumar Sinha       Member Level: Gold
Rating:     Points: 10



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'







Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Date and Time data types in SQL Server 2008  .  Time datatype  .  Sql server datatype  .  Date datatype  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Connecting MySQL database through PHP
Previous Resource: Beyond basics in SQL server 2005
Return to Discussion Resource Index
Post New Resource
Category: Databases


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

SPOC

Contact Us    Privacy Policy    Terms Of Use