How to calculate time difference excluding weekends (saturday and sunday)
From: deepakp <deepak10000_at_hotmail.com>
Date: Wed, 30 Apr 2008 06:49:28 -0700 (PDT)
Message-ID: <318e78d2-99db-4fcb-89a2-4a1eda86f6ad@59g2000hsb.googlegroups.com>
Date: Wed, 30 Apr 2008 06:49:28 -0700 (PDT)
Message-ID: <318e78d2-99db-4fcb-89a2-4a1eda86f6ad@59g2000hsb.googlegroups.com>
I have an Oracle table that has 2 Date fields..i.e. the data type -
DATE
Field 1: START_DATE sample value "2008-04-04 12:00:00";
Field 2: END_DATE sample value "2008-04-07 05:46:07";
If I subtract one date from another, I can get the time difference.
Round((END_DATE - START_DATE), 4) AS TOTAL_DAYS
The above results in 3.7404
Between 2008-04-04 and 2008-04-07, there is Saturday and Sunday which
are 2008-04-05 and 2008-04-06.
I would like them to be excluded.
Hence, the resultant that I'm looking for should be 1.7404 -- not 3.7404
Is there a simple way to get the desired solution?
Thanks,
Deepak
Received on Wed Apr 30 2008 - 08:49:28 CDT