Home » SQL & PL/SQL » SQL & PL/SQL » Count Business Days - Brio software - Oracle DB
Count Business Days - Brio software - Oracle DB [message #202011] Tue, 07 November 2006 18:21 Go to next message
webwiz082
Messages: 1
Registered: November 2006
Junior Member
I'm designing a query using Brio Business Intelligence software, and I'm attempting to formulate some type of function to calculate business days between two dates (excluding Saturdays and Sundays, don't care about holidays). The database which is being worked with is Oracle and I've found many different Oracle functions that do this, but everytime I plug it into Brio, it never works! Always get some error message (ORACLE 936: missing expression is the most common). Can anyone tell me what I'm doing wrong? Thanks in advance.


Re: Count Business Days - Brio software - Oracle DB [message #202060 is a reply to message #202011] Wed, 08 November 2006 01:14 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
You can do it like:
SELECT count(1) thecount
FROM   yourtable
-- the day of week number of Saturday and Sunday change
-- depending on your NLS settings
WHERE  TO_CHAR(yourdate,'D') NOT IN ('7','1')
AND    yourdate BETWEEN startdate AND enddate
AND    ...


Show us what you tried Wink

MHE

[Updated on: Wed, 08 November 2006 01:15]

Report message to a moderator

Previous Topic: Cursors
Next Topic: Snapshots & Materialized views
Goto Forum:
  


Current Time: Fri Dec 09 11:35:11 CST 2016

Total time taken to generate the page: 0.15120 seconds