473,385 Members | 1,570 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to Exclude Sat and sun in APEX 4.1

Hi everyone am using APEX 4.1,

The Leave_transaction Table has the following Fields,
1.Leave_id
2.Emp_name
3.From_date
4.To_date
5.Remaining_days

The Emp_Master Table has the following columns,
1.Emp_id
2.Emp_Name
3.Remaining_days

Expand|Select|Wrap|Line Numbers
  1. select count(*) into days from (select dt
  2. from(
  3.     select to_date(:p1_from_date, 'DD-Mon-YYYY') + rownum -1 dt 
  4.         from dual
  5. connect by level <= to_date(:p1_to_date, 'DD-Mon-YYYY') - to_date(:p1_from_date, 'DD-Mon-YYYY') + 1)
  6. where to_char(dt,'fmday') not in ('sunday','saturday') dual;
  7.  
  8.  
If the Dates is between from_date and To_date comes in Saturday and sunday , it should exclude and return the count(*) remaining dates,
For example,

If the From_date is 04-may-2012'
and To_date is 08-may-2012,

Here the dates 5th may and 6th may are "saturday" and "sunday"



Then the remaining dates are(excluding sat,sunday and dates in holiday_table),

04-may-2012,
07-may-2012
08-may-2012.

so
Expand|Select|Wrap|Line Numbers
  1.  count(*) 
  2.  3
  3.  
I am using the above code but still it returning 5,
I think this

..where to_char(dt,'fmday') not in ('sunday','saturday')

code is not working.
Can anyone help me to solve my Issue.
May 7 '12 #1
1 2417
Rabbit
12,516 Expert Mod 8TB
Isn't Oracle case sensitive by default?
May 7 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: could ildg | last post by:
In re, the punctuation "^" can exclude a single character, but I want to exclude a whole word now. for example I have a string "hi, how are you. hello", I want to extract all the part before the...
1
by: Rajesh Abraham | last post by:
I would like to Exclude MyApp.Exe.Config from my Setup Package as I don't want it to get overwritten during upgrade installation of my application. If I remove app.config while building the...
1
by: Luca from Italy | last post by:
Hello fro Italy, is there anyone who can help me here. This is easy code for inserting data in our company questionnaire. The problems comes when user inser a data with apostrophis. If he writes...
1
by: John Dalberg | last post by:
In VS 2003, I was able to exclude full folders from a project but I can't do the same in VS 2005. I can exclude files but not folders. I prefer to exclude at the folder level because the folder...
2
by: Arsen V. | last post by:
Hi, How to exclude the App_Data directory from Visual SourceSafe? It appears that Vs 2005 automatically adds the App_Data directory with the large binary MDF and LOG files to the Visual...
1
by: AntiChrist | last post by:
In VS 2005 if you exclude files from a project, it actually renames the file to filename.exclude. In previous versions, it just left the file alone but excluded it. If you have a very large...
10
by: Simon Brooke | last post by:
I'm struggling to understand what 'exclude-result-prefixes' does and is for; the language of the standard http://www.zvon.org/xxl/XSLTreference/W3C/xslt.html#literal-result-element is not...
0
by: prohan | last post by:
Hello: I have an Oracle Forms application that needs to call an Apex application and send it 2 values from the currently displayed Oracle Forms Form. I'm not sure how to do this. I know that I...
5
by: viki1967 | last post by:
Problem with onchange event and apex Hi all. I have problem with this onchange event: onChange="window.document.location='upload.asp?B='+this.options.value;"> If B value contains apex...
1
by: garyb2008 | last post by:
My work now needs to share live data with the companies clients. Its simple stuff - based around one table with a few for aux info - and ive been using Zoho Creator DB but this isnt as solid as we...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.