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 !




Doubts in SQL Server


Posted Date: 05 Sep 2008      Total Responses: 2

Posted By: gopinath       Member Level: Bronze     Points: 1


About Date and Time Calculation...

I need to know about the date and time difference and

Day Calculation between the number of days.

Time Intervals or Time\Hours\Minutes\Seconds Calculations are needed.

And I need all the details about the date and time calculations.

Please help me.




Responses

Author: ANIL PANDEY    05 Sep 2008Member Level: DiamondRating:     Points: 3
hi,

u can use the datediff() function to get the difrence between the 2 dates. using this function u can get the difference in the DATES, MONTH and YEAR also...

Syntax is like thus

DATEDIFF ( datepart , startdate , enddate )


USE pubs
GO
SELECT DATEDIFF(day, pubdate, getdate()) AS no_of_days
FROM titles
GO


Thanks
Anil




Author: MuthuKumaresan    05 Sep 2008Member Level: SilverRating:     Points: 2
Dim d1,d2 As Date

d1 = CDate(first date)
d2 = CDate(second date)
tbx_Nodays.Text = DateDiff(DateInterval.Day, d1, d2)


Post Reply
You must Sign In to post a response.
Next : how this query executing explain me?
Previous : Views in SQL Server
Return to Discussion Forum
Post New Message
Category: SQL Server

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

email fax service

Contact Us    Privacy Policy    Terms Of Use