Oracle returning incorrect day of the week

Hi there,
I have a table named Performance, which includes a date field named PDATE, some other attributes such as title, etc, and a field named WEEKDAY, which includes the numerical value for the day of the week. Here is an example:
PER#
P#
THEATRE#
WEEKDAY
PDATE
PHOUR
PMINUTE
COMMENTS
1
1
1
1
02-MAR-10
19
30
Normal evening time
2
1
1
2
03-MAR-10
19
30
Normal evening time
58
6
6
3
04-MAR-10
19
30
Normal evening time
5
1
1
4
05-MAR-10
19
30
Normal evening time
I went to verify the day of the week in a calendar (in fact I checked more than one) and I noticed that the Weekday value seems incorrect. For instance, the 2nd of March was a Tuesday so I would expect WEEKDAY to say 3 (considering Sunday to be the 1st day of the week, which is the universal norm), or perhaps 2 (considering Monday to be the 1st day of the week).
First thing that came to mind is, since the WEEKDAY is a number field which has been pre-populated, the person who populated it made a mistake.
So I went to verify this by running a query that would give me the correct day of the week by extracting it from the PDATE field:
SELECT DISTINCT pdate, EXTRACT(year from pdate) year,
to_char(to_date(pdate,'DD/MM/YYYY'),'DY') weekdaycalc, weekday
FROM ops$yyang00.Performance
ORDER BY pdate
And to my astonishment, I got the following table as a return:
PDATE
YEAR
WEEKDAYCALC
WEEKDAY
02-MAR-10
2010
SUN
1
03-MAR-10
2010
MON
2
04-MAR-10
2010
TUE
3
05-MAR-10
2010
WED
4
06-MAR-10
2010
THU
5
07-MAR-10
2010
FRI
6
08-MAR-10
2010
SAT
7
09-MAR-10
2010
SUN
1
10-MAR-10
2010
MON
2
As you can see, all of the above WEEKDAYCALC values are incorrect, and seem to match the incorrect values in WEEKDAY.
I could perhaps understand some weird WEEKDAY numbering if there is some general database setting where I could specify any day of the week to be the first day. However, I can't think of any logical explanation on why Oracle would call a Tuesday Sunday.
Could someone please advise what I mght be doing wrong? This is driving me insane!
Thank you in advance for all the help and support.
Regards,
P.

Hi,
1bded5c7-e555-4306-ac86-45da83dff439 wrote:
Thanks both Frank and Solomon for the help. I am quite new to Oracle and I feel you folks went the extra mile on the explanation
Based on your explanations, I changed the formula so the date format would be processed as YY rather than YYY.
SELECT DISTINCT pdate, EXTRACT(year from pdate) year,   
to_char(to_date(pdate,'DD/MM/YY'),'DY') weekdaycalc, weekday   
FROM Performance   
ORDER BY pdate  
And I got the correct values now:
PDATE
YEAR
WEEKDAYCALC
WEEKDAY
02-MAR-10
2010
TUE
1
03-MAR-10
2010
WED
2
04-MAR-10
2010
THU
3
05-MAR-10
2010
FRI
4
06-MAR-10
2010
SAT
5
07-MAR-10
2010
SUN
6
08-MAR-10
2010
MON
7
The interesting bit here, is the original WEEKDAY field, which clearly has been created with the same mistake I did (this whole table wasn't created by me). I reckon I spotted a design bug.
Regards,
P.
No; you're still calling TO_DATE on something that is already a DATE, and you're still using an implicit conversion (only now you're using a format such that the current NLS settings don't cause you to get punished.  If your DBA changes the NLS settings next week, then you will have similar errors again.)
If you want to see what day of the week pdate is, then use:
TO_CHAR (pdate, 'DY')
or, to make it NLS-independent:
TO_CHAR (pdate, 'DY', 'NLS_DATE_LANGUAGE=ENGLISH')
This is simpler than what you posted, it's more efficient and easier to debug and to maintain, and it also gets the results you want in all cases.
One more time: TO_DATE, as the name hints, converts something (a VARCHAR2, to be precise) TO a DATE.  If pdate is already a DATE, then what do you need to convert?  You're implicitly converting a DATE to a VARCHAR2, then explicitly converting that VARCHAR2 back to a DATE, and then calling TO_CHAR.  That's 3 function calls (1 of them error prone) where only 1 is needed.
Also if you ever have to reconcile 2-digit years with 4-digit years (and, again, in this problem you don't) the correct way is to convert the 2-digit year to a 4-digit year, not vice-versa.
Calling Tuesday the 1st day of the week could make sense in a particular application.

Similar Messages

  • Days of the week Record selection

    Hi All,
       I have 7 days of week boolean parameters for which when the user selects the date range, they can also filter which days of the week to use within that date range.
    Any ideas on how I can implement this in my record selection formula?
    Thank you in advance.

    Hi,
    You can make use of the DatePart formula
    The following formula will return which day of the week for a particular week.
    Eg:
    The field I am evaluting here Command.DocDate
    If I want to return Wednesday sales then I put in the following in record selection.
    DatePart ("w",{Command.DocDate}, crMonday) = 3

  • In SQL server, how can I pass a date and return on any specific day of the week (e.g. Sunday/Monday/Wednesday, etc.)

    In SQL server, I want to be able to have a function to return the date of any specific day of the week by passing two parameters. E.g.:
    parameter 1: a selected date (e.g. 8/3/2013)
    parameter 2: any specific day of the week (e.g. Wednesday)
    result: should be 7/31/2013 (8/3/2013 is a Sunday in the week 7/28 - 8/3, so the Wednesday should be 7/31/2013)
    then if I want to get Saturday of that week, I can simply change the second parameter to 'Saturday'
    Thanks.

    Wrong forum:
    http://www.microsoft.com

  • Day of the week incorrect in date/time formatting

    This should be a simple fix but I can't seem to find the solution.
    I'm wanting to format my dates using the cell formatting options in the Cells Inspector. Everything is fine except that it's showing the wrong day of the week.
    For example, today is Friday, July 15th, 2011. When I enter 2011-07-15 into the cell, it formats it as Wednesday, July 15, 2011. My time, date and location settings are correct in System Prefs.
    Anyone know where I can fix this? Thanks

    Never mind, I figured it out. I really wish you could delete discussions.

  • Getting the same day of the week from a previous year in a Power Query calc column

    Hi Power Query users,
    Would like to get your suggestions on this problem. I have a customer that wants to see the previous year's sales for the same day of the week. So today is Friday July 25, 2014. Customer would like to see sales for the closest Friday on the previous year,
    which was Friday July 26, 2013. Next year on Friday July 26, 2015, customer would see the sales for Friday July 25, 2014 and so on. Customer operates 7 days a week, all days of the year including holidays.
    What is the most elegant way to do this? I am assuming the best thing to do is to add this date as a calculated column in the date table, but I am not quite sure the best way to write the formula (including handling of edge cases - leap years, providing
    null when the previous year is not part of the date table, etc).
    I am starting with the
    date dimension as presented by Matt Masson.
    Please help if you have any formula suggestions for this.
    Thanks

    Okay, I'm making a couple of assumptions, so please let me know if these assumptions are incorrect:
    1) Instead of all sales data being in a single column, current year and last year sales are provided in different columns,
    2) The previous year sales column shows the sales occurring on the same
    date as the current year sales (so in your example, 43214 is the sales figure for 6/1/2013.
    If the above assumptions are true, we need to modify how the lookup is done. Let's assume that you created a custom column named SameDayOfWeekLastYear. Create another column called Previous Year Date, using the following function (Date_PreviousYear)
    (date) =>
    let   
        PreviousYearDate = Date.AddYears(date,-1),
        PreviousYearDateAdjusted = if (Date.Day(date)=29 and Date.Month(date) = 2) then
                                       #date(9999,1,1)
                                   else PreviousYearDate
    in
        PreviousYearDateAdjusted
    Incidentally, I created this function the week before your query, for a different purpose. In that case, it was to get the previous year sales occurring on the same
    date as the current year sales. It actually gets to your starting point, but with all the sales data in a single column to start with. However, when the current year is a leap year and you apply the Date.AddYears function, February 29th is calculated
    as February 28th of the previous year. If you then do a lookup for previous year sales, you get February 28th sales looked-up twice (the real Feb 28th and the bogus one resulting from taking February 29th back one year). The PreviousYearDateAdjusted identifier
    puts a truly bogus date instead of a duplicated Feb 28th - one that will always return null when looking up the sales value.
    This new date column will then be used to lookup the row of the previous year sales column that corresponds to the dates in the SameDayOfWeekLastYear column.
    Assuming that the last step in your query is InsertedCustom1, create another custom column (Previous Year Net_Same Day?), which returns the sales on the same day as the current year (the result that you're after). The formula would be:
    LookupValue(InsertedCustom1[Previous Year Net], InsertedCustom1[Previous Year Date], [SameDayOfWeekLastYear])
    where LookupValue is the custom function mentioned previously. After creating this new custom column, you can then remove all of the columns you don't need.
    Hope that the preceding is somewhat clear.

  • DATE FOR FIRST DAY OF THE WEEK

    I am new to Oracle and am looking for a procedure that will calculate the first day of the week given today's date.
    Given 1/23/2000 I need to find Sunday 1/21/2000.

    Hi there,
    I don't think there's a built-in Oracle procedure for what you want. However...
    In SQL (at least, Oracle's SQL), you have the function TO_CHAR and TO_DATE that allow you to convert a date to a string and vice-versa. They work pretty much in a similar way, that is :
    TO_<something>( <data_to_convert>, <format> )
    eg.: To have the day of the week for the current date, you can do
    SELECT TO_CHAR( SYSDATE, 'D' ) FROM DUAL;
    Wednesday, January 24th, 2001 would then return 4.
    To have the day of the year, you would do
    TO_CHAR( SYSDATE, 'DDD' )
    Then, to have the day of the year of the first day of the week, you then could subtract the day of the week of your date from the day of the year of your date, and then add one. To be able to do math stuff of char value, you must use TO_NUMBER.
    In one ugly line, you could do this by doing the following :
    select to_date( (to_char(sysdate,'YYYY') &#0124; &#0124; to_char( to_number( to_char(sysdate,'DDD')) - to_number( to_char(sysdate,'D')) + 1)),'YYYYDDD') from dual;
    Eurk.
    Or you could write a function that would return the date of the first day of the week of a specific date, like :
    create or replace
    FUNCTION FDOW (P_DATE DATE) RETURN DATE
    IS
    R_FDOW DATE;
    BEGIN
    R_FDOW := to_date( (to_char(P_DATE,'YYYY') &#0124; &#0124; to_char( to_number( to_char(P_DATE,'DDD')) - to_number( to_char(P_DATE,'D')) + 1)),'YYYYDDD');
    return R_FDOW;
    END;
    (FDOW : First Day Of Week - not really original, I know)
    Then, you can call it wherever you want:
    SELECT FDOW(SYSDATE) FROM DUAL;
    Have fun!
    Frederic Denis

  • Getting first day of the week

    Dear All.
    As there is one function module BWSO_DATE_GET_FIRST_WEEKDAY which returns the first day of the week but its Monday but in our case we require Saturday and in some cases Monday.
    our user in UK are running the same report in which i have to calculate the stock base on starting day Monday and other uses are in KSA where the starting day of the week is Saturday.
    Is there any standard option available do achieve this.
    Kind regards,

    Hi Zeeshan,
    There are two options
    Option 1: In Routine or CMOD or in Variable use offset +5 or -2 according to your reporting requirements.
    Option 2: Maintain the table entries 52 Posting periods in T0009 or in custom table with special FISCAL Variant. (i.e., each week = one posting period). Have a loop up in that table according to your requirement.
    Hope either one of the option would help you in meeting your requirement.
    Best Wishes,
    BVC

  • Want to make Monday as the first day of the week in GregorianCalendar. how?

    hi
    I need to know what day is the first of the month is. for example the 1st of Nov 2004 is Moday and 1st of Dec 2004 is saturday.
    I am using the GregorianCalendar:
    1.  GregorianCalendar calendar = new GregorianCalendar(2004,11,1);    //set date to 1st Nov 2004
    2.  int firstDay = calendar.get(Calendar.DAY_OF_WEEK);now firstDay is 2. This is because the week starts from Sunday, so Monday is the 2nd day.
    But I am in Uk and my Uk Calendar shows monday as the first day (even in Windows 2000 Calendar).
    I would like the GregorianCalendar to have Monday as the first day of the week, so that the
    int firstDay = calendar.get(Calendar.DAY_OF_WEEK);
    returns 1 in the above case.
    I also tried adding
    calendar.setFirstDayOfWeek(Calendar.MONDAY); just between line 1 and line 2, but it did not help.
    This is because i don't want to manually subtract 1. If i manually subtract one, then the program might not work in other locale and timezones.
    Also if I subtract 1, then for 1 Feb 2004,
    int firstDay = calendar.get(Calendar.DAY_OF_WEEK);
    will return 1 as 1st Feb 2004 falls on Sunday. so if i subtract 1 it will be 0, so I have to do a extra checking for 0.
    Is there anyway to make the Calendar have Monday as the first day of the week??
    Tanveer

    hi
    I need to know what day is the first of the month is.Why does this matter? Since we know that 1 == Sunday and 2 == Monday... Why do you need Monday to be == 1? and couldn't you just subtract 1 if it's so important?
    for example the 1st of Nov 2004 is Moday and 1st of
    Dec 2004 is saturday.
    I am using the GregorianCalendar:
    1.  GregorianCalendar calendar = new
    GregorianCalendar(2004,11,1);    //set date to 1st Nov
    2004
    2.  int firstDay = calendar.get(Calendar.DAY_OF_WEEK);now firstDay is 2. This is because the week starts
    from Sunday, so Monday is the 2nd day.
    But I am in Uk and my Uk Calendar shows monday as the
    first day (even in Windows 2000 Calendar).
    I would like the GregorianCalendar to have Monday as
    the first day of the week, so that the
    int firstDay = calendar.get(Calendar.DAY_OF_WEEK);
    returns 1 in the above case.
    I also tried adding
    calendar.setFirstDayOfWeek(Calendar.MONDAY);[/cod
    ] just between line 1 and line 2, but it did not help.
    This is because i don't want to manually subtract 1.
    If i manually subtract one, then the program might not
    work in other locale and timezones.
    Also if I subtract 1, then for 1 Feb 2004,
    int firstDay = calendar.get(Calendar.DAY_OF_WEEK);
    will return 1 as 1st Feb 2004 falls on Sunday. so if i
    subtract 1 it will be 0, so I have to do a extra
    checking for 0.
    Is there anyway to make the Calendar have Monday as
    the first day of the week??
    Tanveer

  • Is there a way to change the start day for the week?

    So I really like the "Insert Categories from the following" functionality of the Reorganize tool, and I fell in love with it's ability to break down by date automagically. I've encountered one problem with my use of it, though: I start my "work week" on Sunday, and it defaults to Monday as the first day of a week without any seeming way to change it to Sunday. Is there a way to do this?

    Hi Christopher,
    The WEEKDAY function allows specifying either Sunday or Monday as the first day of the week:
    WEEKDAY
    The WEEKDAY function returns a number that is the day of the week for a given date. WEEKDAY(date, first-day)
      date:  The date the function should use. date is a date/time value. The time portion is ignored by this function.
      first-day: An optional value that specifies how days are numbered.
    Sunday is 1 (1 or omitted):  Sunday is the first day (day 1) of the week and Saturday is day 7.
    Monday is 1 (2):  Monday is the first day (day 1) of the week and Sunday is day 7. Monday is 0 (3):  Monday is the first day (day 0) of the week and Sunday is day 6.
    But I think you are referring to the first day of the 'workweek', for which I do not see a means of defining a custom value.
    Since you want to 'insert categories', though, you could easily define your own, using WEEKDAY(date) or WEEKDAY(date,1), plus an IF statement to return the category label appropriate to the day. Here's one for a Sunday to Thursday work week. Dates are in column A, the formula is in whichever column you want as the Category column. For the example, I've placed it in column B.
    B2, and filled down: =IF(WEEKDAY(A)<6,"Work","Off")
    The top table shows the weekday numbers returned for each day of the week for each of the three permitted values for the optional second argument. The bottom table shows the results from the formula above, used to define a category label for each date:
    A10 was left blank intentionally, to determine if the lack of data resulted in an error. The Warning message, flagged by the blue 'warning' triangle, is "The formula uses a number in place of a date." The 'date' assigned to this numerical value of zero was a Friday, but I'm not certain when. Probably best to avoid extra rows with no date shown.
    Regards,
    Barry

  • Moving a GregorianCalendar to the first day of the week

    I'm using a GregorianCalendar class in order to get the time stamp for the nearest Sunday's date.
    here's what I'm trying to do:
    1. get a timeStamp and set it into a date
    Date startDate = new Date(startTime);2. create a new GregorianCalendar using the above date as the start time.
    GregorianCalendar calendar = new GregorianCalendar((startDate.getYear()+1900),startDate.getMonth(),startDate.getDate());3. the tricky part: make sure the calnedar's date is set to Sunday, if the current date is on any day other then Sunday, I will have to move it back to the nearest Sunday. I'm trying to do this by using:
    calendar.set(Calendar.DAY_OF_WEEK, 0);     for some reason this does not work...
    am I doing anything wrong here?

    thanks for that info but the problem is still there. here's some more input:
    //creating the date, the ts here is 1153858800000 which is the dated in 7/25/2006
    Date startDate = new Date(startTime);
    //creating the new calendar
    GregorianCalendar calendar = new GregorianCalendar((startDate.getYear()+1900),startDate.getMonth(),startDate.getDate());
    //setting the calendar to the first hour (not sure it necessary)
    calendar.set(Calendar.HOUR, 1);
    //setting the calendar to the first day of the week
    calendar.set(Calendar.DAY_OF_WEEK, 1);
    //this returns 1153778400000 which is still dated 7/25/2006 whic is a Tuesday I would expect it to returns a different date
    calendar.getTimeInMillis()     

  • Day of the week?

    Is there a way to check if the entered date is a certain day of the week?
    I just would like to alert the user if the date that was entered, which i have format "m/d/yy" on the format properties, that the date they entered is not a Sunday date. I tried to use the util.scand function but then was unable to figure out how to script it to look for the value to be Sunday.
    I tried to put the following in the validation script:
    var EFDT = event.value;
    var day = util.scand("dddd", EFDT);
    if(day.value!="Sunday")
    {app.alert("Most changes should be effective on a Sunday, please check that the entered date is the correct date that the change should take place.")}
    console.println(day.value)
    the only time I get the alert is when I reset the form...
    in the debugger i get:
    day is null
    4:Field:ValidateException in line 4 of function top_level, script Field:Validate
    TypeError: day is null
    4:Field:Validate
    i am sure this means that my if criteria is not correct syntax, but i have run into a dead end when trying to search for more help.
    Thanks in advance for any help you can provide...

    The custom validate script for the data field could be something like:
    (function () {
        // Do nothing if field is blank
        if (!event.value) return;
        // Get the entered date, as a date object
        var ed = util.scand("m/d/yy", event.value);
        // If the date is not a Sunday...
        if (ed.getDay() !== 0) {
            // Alert user
            app.alert("Your message goes here.", 3);
            // Optionally, reject the entry
            event.rc = false;
    Edit: corrected code

  • Range Partitioning a table based on day of the week

    I have a logging table which i want to partition into 7 partition, each one for the day of the week, eg MON,TUE, WED. I am aware and I can do a list partition by creating a parition key which stores 'DY' of the week and this means that I need to add another column to the existing table.
    I wanted to explore the option of creating a range parition based on the timestamp column that already exists. Can anyone let me know if this option is possible?
    Example
    create table test_partition
    ( log_id number,
    log_date TIMESTAMP(6),
    log_value varchar2(100)
    PARTITION BY RANGE (log_date)
    PARTITION p1_mon VALUES LESS THAN (), ---- Not sure what can be used here to create this parition.
    PARTITION p2_tue VALUES LESS THAN (),
    PARTITION p3_wed VALUES LESS THAN (),
    PARTITION p4_thu VALUES LESS THAN (),
    PARTITION p5_fri VALUES LESS THAN (),
    PARTITION p6_sat VALUES LESS THAN (),
    PARTITION p7_sun VALUES LESS THAN ()
    Any oracle guru with some suggestion for this would be highly appreciated..
    Cheers,
    VJ

    Something like:
    PARTITION P1_MON VALUES LESS THAN (TIMESTAMP'2009-03-10 00:00:00')
    ....Bear in mind that you will have to write a procedure to drop and create your daily partitions, and run that on a daily basis. Also you would be well advised to create a catchall partition that holds anything that won't go into your latest specified partition, eg:
    PARTITION P_MAX VALUES LESS THAN (MAXVALUE)

  • How can i find the 1st business day of the week ?

    Hi,
    How can i find the 1st business day of the week excluding saturaday,sunday and holidays? i have holiday table which contains the columns name HolidayDate and HolidayDescription.
    Ex:
    10-1-2011 is monday(i.e) 1st business day.check If it is in holiday table,then return the result as 11-1-2011 else return the result as 11-1-2011(which is the first business day of this week).
    Can anyone tell me the Query to solve it?

    Does this help:
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (SELECT TRUNC(SYSDATE,'IW') holiday FROM dual
      2  UNION SELECT TRUNC(SYSDATE + 7,'IW') from dual)
      3  SELECT MIN(Dat),wk FROM
      4  (SELECT TO_CHAR(dat,'IW') wk,dat FROM
      5  (SELECT dat + lvl dat FROM
      6  (SELECT TRUNC(SYSDATE,'RRRR') dat, level - 1 lvl
      7  FROM dual
      8  CONNECT BY level <= TO_DATE('31-DEC'||TO_CHAR(SYSDATE,'RRRR')) - TRUNC(SYSDATE,'RRRR'))
      9  ) x
    10  WHERE x.dat NOT IN (select holiday from t))
    11  WHERE TO_CHAR(Dat,'DY') <> 'SAT'
    12  AND TO_CHAR(dat,'DY') <> 'SUN'
    13* group by wk
    SQL> /
    MIN(DAT)  WK
    04-JAN-11 01  -- since 03-JAN-2011 is in holiday list, 04 is taken as first business day of first week
    11-JAN-11 02  -- similar to week 1
    17-JAN-11 03
    24-JAN-11 04
    31-JAN-11 05
    07-FEB-11 06
    14-FEB-11 07
    21-FEB-11 08
    28-FEB-11 09
    07-MAR-11 10
    14-MAR-11 11
    21-MAR-11 12
    28-MAR-11 13
    04-APR-11 14
    11-APR-11 15
    18-APR-11 16
    25-APR-11 17
    02-MAY-11 18
    09-MAY-11 19
    16-MAY-11 20
    23-MAY-11 21
    30-MAY-11 22
    06-JUN-11 23
    13-JUN-11 24
    20-JUN-11 25
    27-JUN-11 26
    04-JUL-11 27
    11-JUL-11 28
    18-JUL-11 29
    25-JUL-11 30
    01-AUG-11 31
    08-AUG-11 32
    15-AUG-11 33
    22-AUG-11 34
    29-AUG-11 35
    05-SEP-11 36
    12-SEP-11 37
    19-SEP-11 38
    26-SEP-11 39
    03-OCT-11 40
    10-OCT-11 41
    17-OCT-11 42
    24-OCT-11 43
    31-OCT-11 44
    07-NOV-11 45
    14-NOV-11 46
    21-NOV-11 47
    28-NOV-11 48
    05-DEC-11 49
    12-DEC-11 50
    19-DEC-11 51
    26-DEC-11 52
    52 rows selected.
    SQL>

  • Spelling error: Days of the week

    Hello Gurus,
           I defined the character length as 9 but still the days of the week shows an error with fields like Wednesday and Saturday. It just shows as Wednesdy. Is it defined by SAP that way or where does the problem lie. I mean the custom object is deriving it from an SAP defined object but the result shows errors in just these 2 days of the week.
           So please let me know your analysis.
    Thanks,
    Anjali

    Hi Anjali,
    You are correct. This problem is occuring because the days are spelt incorrectly by SAP. In SE24, look at class CL_RSAR_FUNCTION. In the menu > Goto > Text Elements...you will see the incorrect spellings. To change this you would need an access key...I am not sure if there is a note to correct this.
    Hope this helps...

  • Range Partitioning for the day of the week

    I have a logging table which i want to partition into 7 partition, each one for the day of the week, eg MON,TUE, WED. I am aware and I can do a list partition by creating a parition key which stores 'DY' of the week and this means that I need to add another column to the existing table.
    I wanted to explore the option of creating a range parition based on the timestamp column that already exists. Can anyone let me know if this option is possible?
    Example
    create table test_partition
    ( log_id number,
    log_date TIMESTAMP(6),
    log_value varchar2(100)
    PARTITION BY RANGE (log_date)
    PARTITION p1_mon VALUES LESS THAN (), ---- Not sure what can be used here to create this parition.
    PARTITION p2_tue VALUES LESS THAN (),
    PARTITION p3_wed VALUES LESS THAN (),
    PARTITION p4_thu VALUES LESS THAN (),
    PARTITION p5_fri VALUES LESS THAN (),
    PARTITION p6_sat VALUES LESS THAN (),
    PARTITION p7_sun VALUES LESS THAN ()
    Any oracle guru with some suggestion for this would be highly appreciated..
    Cheers,
    VJ

    VJ,
    Here is an example of daily partitioning , let me know if this is what you want or you can modify this even to weekly, monthly, quarterly and yearly partitions.
    CREATE TABLE YY_EVENT
      PART_KEY       DATE                           NOT NULL,
      SUBPART_VALUE  NUMBER                             NULL,
      EVENT_NAME     VARCHAR2(30 BYTE)                  NULL,
      EVENT_VALUE    NUMBER                             NULL
    TABLESPACE TEST_DATA
    PARTITION BY RANGE (PART_KEY)
      PARTITION Y_EVENT_20090310 VALUES LESS THAN (TO_DATE(' 2009-03-11 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
        LOGGING
        NOCOMPRESS
        TABLESPACE TEST_DATA, 
      PARTITION Y_EVENT_20090311 VALUES LESS THAN (TO_DATE(' 2009-03-12 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
        LOGGING
        NOCOMPRESS
        TABLESPACE TEST_DATA
    )Regards

Maybe you are looking for

  • No connect to database possible while logging in sap system

    hi to all experts , all the work process are wait state but with one work process i have error 1 and when im trying to logon to sap im getting this message no connect to database possible session terminated dev_disp trc file: "dev_disp", trc level: 1

  • Problems while watching Dvds

    Hi I have bought a 32 Hl833 10 days ago -- everything is alright while watching the regular Tv channels -- the problems is when I am watching Dvd movies on my Dvd device -- Dvd device is connected with TV with Scart (P.S., I am from the eastern Europ

  • Report for cost component wise standard cost

    Dear All, I can view cost component structure wise breakup of cost for materials through various options in controlling. But, I can view that only material wise, I am unable to find any report which can allow me to view cost component structure wise

  • Delete

    Hi Friends, How to delete the rows from the table control in the screen painter. Kindly guide me. Regards, Mark  K

  • Drop Zone Template changes from 8 to 2 sec

    Why does a template with a drop zone change the duration from the existing duration to 2 sec? I drop a picture into a drop zone either in the viewer or on the project window. Am I doing something wrong? Library selection/drag to viewer or project win