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
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
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


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

Report message to a moderator

Previous Topic: Tuning SQL query
Next Topic: Cursors
Goto Forum:

Current Time: Sat Aug 19 15:33:26 CDT 2017

Total time taken to generate the page: 0.01571 seconds