Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to calculate the hours elapsed between two dates?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I want to figure out how many hours have elapsed between a start date and an end date. How do I do this? I need help!!!! thanks in advance..
 
Try the Date difference formula:

This will Return the number of date and time boundaries crossed between two specified dates.

Syntax

DATEDIFF(datepart, startdate, enddate)

This example determines the difference in days between the current date and the publication date for titles in the pubs database.
DATEDIFF(day, pubdate, getdate()) AS no_of_days
Kamal Khalil
Sr. Client Technical Analyst
kkhalil@Houston.ds.adp.com
 
How would you calculate the date differnce including only "business" days mon-friday , excluding Sat and Sun in the total ?

Thanks
 
See FAQ 1.B, formula nmber 1.
This formula can also eliminate holidays if you put them into the list. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Ken you always mention the FAQ and its sections but where is it? Can anyone post the link to it please?
 
If you already looking at this page, that means you already passed it.
So, click on the back arrow, to go back one page and look at the tabs in the middle of the page.
One of them is FAQs.
Click on that, and then check the specific item you wish.
In this case it is FAQ 1.B as Ken stated. Kamal Khalil
Sr. Client Technical Analyst
kkhalil@Houston.ds.adp.com
 
If you go to the main page of any forum (click the forum in your threadminder list) the FAQ button is one of the four tabs at the top, just above the list of questions on each page. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top