How to calculate  number of sundays and saturdays between two Dates

friends i want to calculate how many Sundays come in two Dates
i have tried following code which is hard coded i have to impliment method which can give me number of Sundays between two Dates
please help me
import java.util.Date;
     import java.text.DateFormat;
     import java.text.SimpleDateFormat;
     import java.util.Calendar ;
     import java.util.GregorianCalendar;
public class DateDiffCalculator     {
     private static final SimpleDateFormat SDF = new SimpleDateFormat("yyyy-MMM-dd");
public DateDiffCalculator()     {
     public static Date getDate (String date) throws Exception {
//log.debug(" "+date);
          return SDF.parse(date);
public static Date getDate (Date date) throws Exception {
// log.debug("date is "+date);
          return getDate(SDF.format(date));
public static long getDiffInDays(Date d1,Date d2)     {
     boolean isdiffGreaterThanYear=false;
     long diffInMilliSeconds=d1.getTime()-d2.getTime();
     return diffInMilliSeconds/(1000*60*60*24);
public static int getYear(String date)     {
          //String[] day=     {Sun,Mon,Tue,Wed,Thu,Fri,Sat};
          Integer     year=new     Integer(date.substring(0,4));
     return year.intValue();
public static int getMonth(String date)     {
          //String date.substring(5,7);
          System.out.println(" "+date.substring(5,8));
          String     m= date.substring(5,8);
          int month=0;
          if(m.equalsIgnoreCase("Jan"))     {
          month=1;
          if(m.equalsIgnoreCase("Feb"))     {
          month=2;
          if(m.equalsIgnoreCase("Mar"))     {
          month=3;
          if(m.equalsIgnoreCase("Apr"))     {
          month=4;
          if(m.equalsIgnoreCase("May"))     {
          month=5;
          if(m.equalsIgnoreCase("Jun"))     {
          month=6;
          if(m.equalsIgnoreCase("Jul"))     {
          month=7;
          if(m.equalsIgnoreCase("Aug"))     {
          month=8;
          if(m.equalsIgnoreCase("Sep"))     {
          month=9;
          if(m.equalsIgnoreCase("Oct"))     {
          month=10;
          if(m.equalsIgnoreCase("Nov"))     {
          month=11;
          if(m.equalsIgnoreCase("Dec"))     {
          month=12;
          return month;
     public static int getDay(String date)     {
          Integer     day=new     Integer(date.substring(9,11));
     return day.intValue();
public static int getNumberofSundays(String d1,String d2) throws Exception     {
          //d1 is leave start date d2 is leave end date
          // get object in Date form
               Date date1=getDate(d1);
               Date date2=getDate(d2);
          // now get calender objects from it
          GregorianCalendar c1= new GregorianCalendar(getYear(d1),getMonth(d1),getDay(d1));
          GregorianCalendar c2= new GregorianCalendar(getYear(d2),getMonth(d2),getDay(d2));
          // get period
          long leavePeriod = getDiffInDays(date1,date2);
     return 12; // it should return number of sundays but we type 12 to perform compilation
public static void main(String[] arg)throws Exception     {
System.out.println(" "+getNumberofSundays("2005-Oct-07","2006-Mar-01"));
}

thanks now i have modified the get Month Code
as follows
public static int getMonth(String date)     {
          //String date.substring(5,7);
          System.out.println(" "+date.substring(5,8));
          String     m= date.substring(5,8);
          int month=0;
          if(m.equalsIgnoreCase("Jan"))     {
          month=0;
          if(m.equalsIgnoreCase("Feb"))     {
          month=1;
          if(m.equalsIgnoreCase("Mar"))     {
          month=2;
          if(m.equalsIgnoreCase("Apr"))     {
          month=3;
          if(m.equalsIgnoreCase("May"))     {
          month=4;
          if(m.equalsIgnoreCase("Jun"))     {
          month=5;
          if(m.equalsIgnoreCase("Jul"))     {
          month=6;
          if(m.equalsIgnoreCase("Aug"))     {
          month=7;
          if(m.equalsIgnoreCase("Sep"))     {
          month=8;
          if(m.equalsIgnoreCase("Oct"))     {
          month=9;
          if(m.equalsIgnoreCase("Nov"))     {
          month=10;
          if(m.equalsIgnoreCase("Dec"))     {
          month=11;
          return month;
but question remains same how to calculate number of Sundays Between 2 Dates

Similar Messages

  • How to count the number of Fridays and Saturdays between two dates

    Hi every one ... If we want to count the number of Fridays and Saturdays between two dates, how would we do that ? !
    Dates are ( 11-Feb-2010) to (19-May-2010)
    how to do it in SQL
    Edited by: khalidoracleit on Jul 28, 2010 5:51 AM

    some nice coding here, I'm still amazed with what some people can do with "connect by". But I agree with some statements here that this can take "time", and to be honest, it's funny to see it working, but if you do not have a computer, just a calendar and some paper, would you go for "counting" so there must be a better solution?
    The best working math in here is done by Aketi Jyuuzou, who writes so good English that I wonder why he still insists that he doesn't ;-)
    Anyhow I "translated" that code to English, and I really like that math. Math is math and data is data.
    ALTER SESSION SET NLS_DATE_LANGUAGE='ENGLISH';
    WITH my_dates AS (
    SELECT to_date('20100211','yyyymmdd') start_date,to_date('20100519','yyyymmdd') end_date FROM DUAL
    UNION ALL
    SELECT to_date('20100211','yyyymmdd') start_date,to_date('20100214','yyyymmdd') end_date FROM DUAL
    UNION ALL
    SELECT to_date('20100211','yyyymmdd') start_date,to_date('20100213','yyyymmdd') end_date FROM DUAL
    UNION ALL
    SELECT to_date('20100211','yyyymmdd') start_date,to_date('20100212','yyyymmdd') end_date FROM DUAL
    SELECT to_char(start_date,'DD.MM.YYYY') start_date,to_char(end_date,'DD.MM.YYYY') end_date,
           to_char(start_date,'DAY') start_weekday,to_char(end_date,'DAY') end_weekday,
           end_date-start_date day_difference,
           (next_day(end_date,'FRIDAY')-7
           -next_day(start_date -1,'FRIDAY'))/7+1
           +(next_day(end_date,'SATURDAY')-7
           -next_day(start_date -1,'SATURDAY'))/7+1 as count_of_fr_and_sat
    FROM my_dates;
    START_DATE END_DATE   START_WEEKDAY                        END_WEEKDAY                          DAY_DIFFERENCE         COUNT_OF_FR_AND_SAT   
    11.02.2010 19.05.2010 THURSDAY                             WEDNESDAY                            97                     28                    
    11.02.2010 14.02.2010 THURSDAY                             SUNDAY                               3                      2                     
    11.02.2010 13.02.2010 THURSDAY                             SATURDAY                             2                      2                     
    11.02.2010 12.02.2010 THURSDAY                             FRIDAY                               1                      1                      -- andy

  • How to get days and months when two dates are given

    Hi All,
    I have a requirement where I need to return the number of months and days between given dates.
    I dont need to take the year into account as the dates difference is always less than an year
    I have 28-jun-2012 and 31-jan-2013 as dates.
    I'm working on 10g
    when I do select months_between(:a,:b) from dual and provide those dates it gives me 7.09677
    I want it to give as 7 months and 9 days or what ever the exact days are.
    Your inputs are much appreciated

    BluShadow wrote:
    874719 wrote:
    Thanks a lot,BluShadow for your answer and would you mind giving it for the year as well like 0 years 7 months 3 days?Your original post said:
    I dont need to take the year into account as the dates difference is always less than an yearNow you've got the idea, why not have a go yourself first, and then if you're still not getting it, post what you've tried so we can help you.Oh... go on... I'm in a good mood today...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select date '2012-06-28' as start_date, date '2013-01-31' as end_date from dual union all
      2             select date '2012-02-29', date '2012-06-30' from dual union all
      3             select date '2010-02-28', date '2012-06-30' from dual union all
      4             select date '2012-02-29', date '2012-06-15' from dual
      5            )
      6  --
      7  select start_date, end_date
      8        ,months_between(end_date,start_date) as mnth_bet
      9        ,floor(months_between(end_date,start_date)/12) as yr
    10        ,floor(mod(months_between(end_date,start_date),12)) as mnth
    11        ,case when to_number(to_char(end_date,'DD')) >= to_number(to_char(start_date,'DD')) then
    12           to_number(to_char(end_date,'DD')) - to_number(to_char(start_date,'DD'))
    13         else
    14           (to_number(to_char(last_day(start_date),'DD'))-to_number(to_char(start_date,'DD')))+
    15           (to_number(to_char(end_date,'DD')))
    16         end as dys
    17* from t
    SQL> /
    START_DATE           END_DATE               MNTH_BET         YR       MNTH        DYS
    28-JUN-2012 00:00:00 31-JAN-2013 00:00:00 7.09677419          0          7          3
    29-FEB-2012 00:00:00 30-JUN-2012 00:00:00          4          0          4          1
    28-FEB-2010 00:00:00 30-JUN-2012 00:00:00         28          2          4          2
    29-FEB-2012 00:00:00 15-JUN-2012 00:00:00  3.5483871          0          3         15

  • Can i share music and photos between two users on the same machine?

    How can I share my music and photos between two users on the same machine?

    Thank you Joe - I tried this but it's only showing a teensy amount of music - the stuff on the second users account as opposed to the giagntic library on the 'main' account. I actually went to a Genius Bar and they said that apple doesn't really want you to share music between accounts - parents don't want to hear their kids music etc. Which seemed strange, but it might be the case sadly   Thanks anyway!

  • How to Calculate number of months between two dates

    Hi All,
       In one of the fomr developments, I have to calculate the
    Number of Days
    Number of Months ( Considering Leap Year) provided by the dates, end user enters in the form,
    After going thorugh some forum discussion, I have come to know about so many things which were not clear till now.
    I have gone through various forums too,  some one suggets to make use of FORM CALC and some other JAVA SCRIPT. But the logic i want to build in java script.
    The most interesting point is the DATE object is not getting created when i write  the below code
      var startDate = new DATE(oYear, oMonth, oDay);
    I am still not clear, that really the date object gets created in Adobe form If so the why the alert box is getting populated when i write below lines
    var oTemp = startDate.getFullYear();
    xfa.host.messagebox(oTemp);
    So, there are so many unclear things,
    If any one can help me by suggesting the approach and how to build the logic in the JavaScript I would be really thankful
    Regards
    PavanChand

    Hi,
    ChakravarthyDBA wrote:
    Hi
    I want number of Sundays between two dates
    example
    number of Sundays count between '01-04-2013' and '30-04-2013' in one select query I have to include this as sub query in my select statement.Here's one way:
    SELECT       early_date
    ,       late_date
    ,       ( TRUNC (late_date + 1, 'IW')
           - TRUNC (early_date,        'IW')
           ) / 7       AS sundays
    FROM       table_x
    ;This does not depend on your NLS settings.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
    Point out where the statment above is getting the wrong results, and explain, using specific examples, how you get the right results from the given data in those places.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • How to calculate number of rows for perticular characterstic in SAP BI Bex

    Hi experts,
    Please let me know how to calculate  ' number of rows  ' for perticular characterstic in Bex query. 
    Thanks & Regards,
    Babu..

    Hello,
    You can try this
    Create a CKF and assign the vale 1 to it. Open the query and select Character where you want to display ' number of rows ', go to properties windows, select 'display', in the results row drop down box, select  'always display'.
    Thanks.
    With regards,
    Anand Kumar

  • I wanted to know how do you calculate the number of days between two dates

    i wanted to know how do you calculate the number of days between two dates in java ? i get both the dates from the database. i guess there are many issues like leap year and Febuary having diff no of months ..etc.

    thanks..
    I solve my problem as
    public class MyExample {
        public static void main(String a[]) {
            String stdate = "2009-03-01";
            java.sql.Date currentDate = new java.sql.Date(System.currentTimeMillis());
            java.sql.Date preDate = java.sql.Date.valueOf(stdate);
            System.out.println(currentDate);
            System.out.println(preDate);
    //        int dateCom = preDate.compareTo(currentDate);
    //        System.out.println(dateCom);
            long diff = currentDate.getTime() - preDate.getTime();
            int days = (int) Math.floor(diff / (24 * 60 * 60 * 1000));
             System.out.println(days);
    }

  • How to calculate Number of Hours between 2 dates

    Hi,
    I have a Column in a table of datatype DATE i.e. Update_Date. Now How do I calculate number of hours passed starting from this date entered in the Update_Date column to SYSDATE. e.g. if the date in column is 2-FEB-2009 and the sysdate is 2/2/2009 2:07:40 AM it should give me 24. How can I get this number of hours.
    Update_Date - Sysdate = Number of Hours.
    Thanks

    When you subtract two dates in Oracle, you get a difference in terms of days. Just multiply that by 24 to get hours.
    SELECT (sysdate - update_date) days,
           (sysdate - update_date) * 24 hours
      FROM your_tableThat said, it is not obvious how your example works. You state
    if the date in column is 2-FEB-2009 and the sysdate is 2/2/2009 2:07:40 AM it should give me 24Since both dates are on February 2, 2009, the only difference is in the time component. If we assume that the time component of the UPDATE_DATE value is midnight since it is not specified, there is a little more than 2 hours of difference between the two dates. How is it that you determine there are 24 hours of difference?
    Justin
    Edited by: Justin Cave on Feb 2, 2009 10:39 AM

  • How to calculate number of days in ABAP?

    Hi,
    I have a condition as below:
    If (field1 - field2) > 12 Months
    E.g field1 = 31.05.2011 & field2 = 10.11.2011
    Can SAP actually minus dates and check if the difference is greater than 12 months?
    How do I perform this calculation?
    Pls advice.
    Thanks!
    Moderator message : Date FAQ, duplicate post.  Thread locked.
    Edited by: Vinod Kumar on Mar 2, 2012 1:50 PM

    Hi,
    If your calculating dates please do not manually calculate it like that.
    You need to determine like week numbers, month and days.
    The best way to do it is by using FM related to dates. Play around with these FMs in your program:
    Function Modules related to Date and Time Calculations
    CALCULATE_DATE  - Calculates the future date based on the input .
    DATE_TO_DAY - Returns the Day for the entered date. 
    DATE_COMPUTE_DAY - Returns weekday for a date
    DATE_GET_WEEK - Returns week for a date
    RP_CALC_DATE_IN_INTERVAL - Add days / months to a date
    DAY_ATTRIBUTES_GET - Returns attributes for a range of dates specified
    MONTHS_BETWEEN_TWO_DATES - To get the number of months between the two dates.
    END_OF_MONTH_DETERMINE_2 - Determines the End of a Month.
    HR_HK_DIFF_BT_2_DATES -Find the difference between two dates in years, months and days.
    FIMA_DAYS_AND_MONTHS_AND_YEARS - Find the difference between two dates in years, months and days.
    WEEK_GET_FIRST_DAY - Get the first day of the week
    SD_CALC_DURATION_FROM_DATETIME - Find the difference between two date/time and report the difference in hours
    L_MC_TIME_DIFFERENCE - Find the time difference between two date/time
    HR_99S_INTERVAL_BETWEEN_DATES - Difference between two dates in days, weeks, months
    LAST_DAY_OF_MONTHS - Returns the last day of the month
    DATE_CHECK_PLAUSIBILITY - Check for the invalid date.
    DATE_2D_TO_4D_CONVERSION - Year entry: 2-character to  4-character.
    DAY_IN_WEEK  - Input date and will give the name of the day 1-monday,2-Tuesday....
    SD_DATETIME_DIFFERENCE - Give the difference in Days and Time for 2 dates

  • How to count number of sundays between two dates

    Hi
    I want number of Sundays between two dates
    example
    number of Sundays count between '01-04-2013' and '30-04-2013' in one select query I have to include this as sub query in my select statement.

    Hi,
    ChakravarthyDBA wrote:
    Hi
    I want number of Sundays between two dates
    example
    number of Sundays count between '01-04-2013' and '30-04-2013' in one select query I have to include this as sub query in my select statement.Here's one way:
    SELECT       early_date
    ,       late_date
    ,       ( TRUNC (late_date + 1, 'IW')
           - TRUNC (early_date,        'IW')
           ) / 7       AS sundays
    FROM       table_x
    ;This does not depend on your NLS settings.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
    Point out where the statment above is getting the wrong results, and explain, using specific examples, how you get the right results from the given data in those places.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • Getting the data between Sunday and Saturday of last week.(DAYS NOT DATES)

    I have a stored procedure (that has no parameters right now) and does some extraction of data from different tables. One of the table has a column called 'DeliveryDate'.
    Based on the requirements, I have to create an SSRS 2008 R2 Report out of that stored procedure, so that users can see the data of last week from Sunday(Start DAY) to Saturday(End DAY). Even if it is Wednesday today, they should be able to see the data
    from Last Sunday to this Saturday. I don't want to get data of Monday, tuesday or wednesday. Also, these values shouldn't be STATIC. Meaning, if one user wanted to see deliveries on 04-15-2011, then he shoud see the values of the previous week (and NOT
    CURRENT week)
    1. Do I need to create parameters in my stored proc. Are they needed at all ?
    2. Should I use DateAdd, Datediff functions (If someone can explain, how will they be calculated!)

    to get last week sunday and saturday use below. I prefer to use parameters.
    set @startdate = DATEADD(wk,
    DATEDIFF(wk,
    0,
    getdate()),
    -2) --for
    sunday
    set @enddate = DATEADD(wk,
    -1,
    DATEADD(wk,
    DATEDIFF(wk,
    0,getdate()),
    -1))-- for saturday
    also
    refer the following link
    http://blog.sqlauthority.com/2008/08/29/sql-server-few-useful-datetime-functions-to-find-specific-dates/
    ESHANI. Please click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you
    If I run the query on 5/4/2014, will it give me 4/27/2014 for Sunday and 5/3/2014 for Saturday? Meaning if I run it on a Sunday, it will give me the previous Sunday and not the current Sunday's date.

  • How can I calculate the maximum number of days between two dates in a range of dates?

    I have a column of dates spanning the couse of a few months.  I would like to know if I can calculate the maximum number of days between each row and display the highest number.  I currently have another column that calculates the days betwen the rows and I am currently just looking at the totals and highlighting the highest period.
    Is this possible?  Any help or suggestions are appreciated.
    Thank you,
    Trevor

    This sounds totally possible,  Can you post a screen shot of your table to make responding more focused?  If you mean you want to:
    A) compute the difference (in days) between two date in the same row, then
    B) find the max duration (in days)
    Here is my take on this problem:
    D2 = C2-B2
    select D2 and fill down
    F1=MAX(D)
    to perform the conditional formatting (to highlight the max duration) select column D, then set up conditional formatting as shown in the 1st image

  • How to calculate number of days between two date in Template design?

    Hello guys
    I have a situation where I have to create a template that returns data, and one of the thing of the existing report is that there is a column that is actually the number of days between start date and end date columns..
    So in template, how would I be able to do the same? I have start date and end date columns on the template, now when I created another column using expression like end date - start date and preview the template, I am getting errors saying :
    Caused by: oracle.xdo.parser.v2.XPathException: Cannot convert 03/31/2009 to number.
         at oracle.xdo.parser.v2.XSLStylesheet.flushErrors(XSLStylesheet.java:1534)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:521)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:489)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:271)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:155)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:192)
    Please advice
    Thanks

    Hi
    There is an extension function you can use, from the javadoc:
    date_diff
    public static long date_diff(java.lang.String format,
    java.lang.String fromDate,
    java.lang.String toDate,
    java.lang.String locStr,
    java.lang.String tzID)
    Method to get the difference between two dates in the given locale. The dates need to be in "yyyy-MM-dd" format. This function supports only Gregorian calendar.
    Parameters:
    format - the format to which the difference is required; allowed formats are y (for Year), m(for month), w(for week), d(for day), h(for hour), mi(for minute), s(for seconds) and ms(for milliseconds)
    fromDate - the first date
    toDate - the second date
    locStr - locale string -> lang-Territory
    tzID - timezone ID ->http://java.sun.com/j2se/1.4.2/docs/api/java/util/TimeZone.html
    Returns:
    the difference in dates in the desired format
    For example
    <?xdoxslt:date_diff(‘d’,’2009-09-14’, ‘2009-09-20’,’en-US’,1)?>
    give a result of 6
    You can substitute in columns for the dates, just remember the date format required.
    Regards
    Tim

  • How to calculate number of threads  running  on Windows 2000 terminal?

    How to calculate number of threads running on Windows 2000 terminal for the oracle process?
    I have installed Oracle 9i DataBase with 6 patch(9.2.0.6.0) on Windows 2000 Terminal.
    But,after database is started up, when i check up the sessions in v$session view.
    It is showing like for SYSTEM osuser alone, 10 ORACLE.EXE sessions running on this server machine in active state.
    Why it is creating 10 ORACLE.EXE sessions for a single Oracle Server.
    This is the output of v$session view.
    SQL> select terminal,osuser,status,sid,serial#,program from v$session;
    TERMINAL OSUSER STATUS SID SERIAL# PROGRAM
    IMGDBSVR SYSTEM ACTIVE 1 1 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 2 1 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 3 1 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 4 1 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 5 1 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 6 1 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 7 1 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 8 1 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 9 1 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 10 1 ORACLE.EXE
    SUGANTHI_DBA suganthi ACTIVE 11 91 sqlplusw.exe
    11 rows selected.
    SQL>

    This is how i have related these two views:
    SQL> select s.terminal,s.osuser,s.status,s.paddr s_paddr,b.paddr p_paddr,s.program
    2 from v$session s,gv$bgprocess b
    3 where s.paddr=b.paddr;
    TERMINAL OSUSER STATUS S_PADDR P_PADDR PROGRAM
    IMGDBSVR SYSTEM ACTIVE 33AF2270 33AF2270 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 33AF2654 33AF2654 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 33AF2A38 33AF2A38 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 33AF2E1C 33AF2E1C ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 33AF3200 33AF3200 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 33AF35E4 33AF35E4 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 33AF39C8 33AF39C8 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 33AF3DAC 33AF3DAC ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 33AF4958 33AF4958 ORACLE.EXE
    IMGDBSVR SYSTEM ACTIVE 33AF4D3C 33AF4D3C ORACLE.EXE
    10 rows selected.
    SQL>
    Here, It shows 10 sessions are running.
    Whether this means 10 threads are running on the particular server or not?

  • How to count days between two dates excluding saterady and sunday

    Hi all
    iam working on oracle sql/plsql.
    In my application , i need to caliculate leave days between two dates excluding saterady and sunday
    Please tell me the solution if any one knows
    thanks in advance ,
    balu

    More modern version:
    WITH date_tab AS
    (SELECT TO_DATE ('&from_date', 'dd-MON-yyyy')
    + LEVEL
    - 1 business_date
    FROM DUAL
    CONNECT BY LEVEL <=
    TO_DATE ('&to_date', 'dd-MON-yyyy')
    - TO_DATE ('&from_date', 'dd-MON-yyyy')
    + 1)
    SELECT business_date
    FROM date_tab
    WHERE TO_CHAR (business_date, 'DY') NOT IN ('SAT', 'SUN');Thank you,
    Tony Miller
    Webster, TX
    Never Surrender Dreams!
    JMS
    If this question is answered, please mark the thread as closed and assign points where earned..

Maybe you are looking for

  • How would I create a photo gallery like this in Muse?

    Just trying to get the same kind of abilities working in muse. Link for site/gallery below greg noire - photographer

  • ITunes crashes at launch

    I successfully installed iTunes to my computer. However, everytime I try to load the software, I get the Terms and Conditions screen, click Accept. Then I get an error saying that iTunes needs to close and has encountered an error. I've tried reinsta

  • Material Document in MIGO

    Hello, I processed a good receipt on MIGO with mvt code 101. I use MIGO transaction code, but when I display the material document in MIGO, in Doc Info, SAP shows that Transaction code MIGO_GR has been used. Is there a way to make SAP show the transa

  • How to clear "other" storage space

    How do you clear storage space taken up by "other"?

  • Change Data Capture for XML

    We have an XML file being created every week on the mainframe. This file is loaded to Oracle Database. Initially we were performing a refresh of a table, due to business reasons, we need to load only the changes from this XML file to our stage databa