Thursday, February 16, 2012

Calculating time elapsed (weekdays only)

What is the best way to calculate time elapssed between two dates and factor
in wdays only (exclude Saturday and Sunday).
Example:
Friday Jan 28th at 10pm thru Monday Jan 31st at 2am should calculate to 4
hours.
Friday Jan 21st at 10pm thru Monday Jan 31st at 2am should calculate to 124
hours
Thanks in advance,
MarkOn Mon, 31 Jan 2005 15:56:42 -0500, Mark Andrews wrote:

>What is the best way to calculate time elapssed between two dates and facto
r
>in wdays only (exclude Saturday and Sunday).
>Example:
>Friday Jan 28th at 10pm thru Monday Jan 31st at 2am should calculate to 4
>hours.
>Friday Jan 21st at 10pm thru Monday Jan 31st at 2am should calculate to 124
>hours
>Thanks in advance,
>Mark
>
Hi Mark,
Use DATEDIFF to find the total number of hours between the two dates.
Use a calendar table to find the number of non-workdays between the two
dates, multiply by 24 and subtract.
Why should I consider using an auxiliary calendar table? www.aspfaq.2519
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||See if this helps:
How do I count the number of business days between two dates?
http://www.aspfaq.com/show.asp?id=2453
Why should I consider using an auxiliary calendar table?
http://www.aspfaq.com/show.asp?id=2519
AMB
"Mark Andrews" wrote:

> What is the best way to calculate time elapssed between two dates and fact
or
> in wdays only (exclude Saturday and Sunday).
> Example:
> Friday Jan 28th at 10pm thru Monday Jan 31st at 2am should calculate to 4
> hours.
> Friday Jan 21st at 10pm thru Monday Jan 31st at 2am should calculate to 12
4
> hours
> Thanks in advance,
> Mark
>
>

No comments:

Post a Comment