Issue in calculating hours between two dates .. excluding weekends
Using the select statement below I'm getting varying results which don't seem to make sense. I have 4 dates that I'm working with where I subtract one date from another and come up with the number of hours that elapsed, excluding weekends.
select doc_seq seqno, to_char(rcvd_dt,'mm/dd/yyyy hh24:mm:ss') rcvdt,
to_char(scnd_dt,'mm/dd/yyyy hh24:mm:ss') scndt,
to_char(post_dt,'mm/dd/yyyy hh24:mm:ss') ldt,
to_char(vrfd_dt,'mm/dd/yyyy hh24:mm:ss') vdt,
((scnd_dt - rcvd_dt)*24) - (((((TRUNC(scnd_dt,'D'))-(TRUNC(rcvd_dt,'D')))/7)*2)*24) r2s,