Forms 6i Bad first day of week

Hello,
Please help me
We have oracle form 6i application in our organization, in the past we had the same app but the database was 9i (9.2.0.1) and we migrate the database to 10g (10.2.0.1) with the same NLS parameters, the problem is there are forms calculating the first day of the week based in the query :
SELECT TO_CHAR(TO_DATE('03/01/2005','DD/MM/YYYY'),'D')
FROM
DUAL;
this query through the sqlplus (ORACLE_HOME form 6i) return 2
using sqltools client with and without tnsname return 2
in the server using sqlplus with and without tnsname return 2
but when rhe form insert data into data base insert a wrong value the Monday(2) insert as Sunday(1)
INSTANCE
PARAMETER     VALUE
NLS_LANGUAGE     AMERICAN
NLS_TERRITORY     AMERICA
NLS_SORT
NLS_DATE_LANGUAGE
NLS_DATE_FORMAT
NLS_CURRENCY
NLS_NUMERIC_CHARACTERS
NLS_ISO_CURRENCY
NLS_CALENDAR
NLS_TIME_FORMAT
NLS_TIMESTAMP_FORMAT
NLS_TIME_TZ_FORMAT
NLS_TIMESTAMP_TZ_FORMAT
NLS_DUAL_CURRENCY
NLS_COMP
NLS_LENGTH_SEMANTICS     BYTE
NLS_NCHAR_CONV_EXCP     FALSE
DATABASE
PARAMETER     VALUE
NLS_LANGUAGE     AMERICAN
NLS_TERRITORY     AMERICA
NLS_CURRENCY     $
NLS_ISO_CURRENCY     AMERICA
NLS_NUMERIC_CHARACTERS     .,
NLS_CHARACTERSET     WE8ISO8859P1
NLS_CALENDAR     GREGORIAN
NLS_DATE_FORMAT     DD-MON-RR
NLS_DATE_LANGUAGE     AMERICAN
NLS_SORT     BINARY
NLS_TIME_FORMAT     HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT     DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT     HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT     DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY     $
NLS_COMP     BINARY
NLS_LENGTH_SEMANTICS     BYTE
NLS_NCHAR_CONV_EXCP     FALSE
NLS_NCHAR_CHARACTERSET     AL16UTF16
NLS_RDBMS_VERSION     10.2.0.1.0
CLIENTES FORMS REGEDIT KEY NLS_LANG
LATIN AMERICAN SPANISH_AMERICA.WE8ISO8859P1
Thank foy your help, and sorry for my English

Gerd, that German Weekday function is nice. I looked it over and tried out various things, especially those suggested by JWH and Laurent Schneider in the comments. Using JWH's method, I came up with this function below.
I have tried it out with every NLS_Territory setting I can find, and it works everywhere:
  Function week_day_standard(d in date) return number is begin
  -- This function returns a value from 1 to 7 identifying
  -- the day of the week, where Monday is always 1, and
  -- Sunday is 7.
  -- In Oracle, depending on the NLS_Territory setting,
  --   different days of the week are 1.
  -- Examples:
  --   U.S., Canada, Monday = 2;  Most European countries, Monday = 1;
  --   Most Middle-Eastern countries, Monday = 3.
  --   For Bangladesh, Monday = 4.
    Return 1 + mod(to_number(to_char(d,'J')),7);
  End week_day_standard;And here is a SQL Plus script I used to verify the function:
clear screen
Declare
  S  varchar2(1);
  M  varchar2(1);
  Function week_day_standard(d in date) return number is begin
  -- This function returns a value from 1 to 7 identifying
  -- the day of the week, where Monday is always 1, and
  -- Sunday is 7.
  -- In Oracle, depending on the NLS_Territory setting,
  --   different days of the week are 1.
  -- Examples:
  --   U.S., Canada, Monday = 2;  Most European countries, Monday = 1;
  --   Most Middle-Eastern countries, Monday = 3.
  --   For Bangladesh, Monday = 4.
    Return 1 + mod(to_number(to_char(d,'J')),7);
  End week_day_standard;
  procedure go3 (d1 date) is
   d date := d1;
  begin
    loop
      d := d+1;
      DBMS_Output.Put_Line('          '
       ||       to_char(d,'Dy, mm-dd-yyyy D')
       ||'  '|| to_char( d+1-trunc(d,'iw') )
       ||''  || week_day_standard(d)
       ||''  || to_char(1+mod(to_number(to_char(d,'J')),7))
       ||'  '|| to_char(trunc(d,'iw'),'mm-dd-yyyy')  );
      exit when to_char(d,'mmdd')='0104';
    end loop;
    DBMS_Output.Put_Line(' ');
  end go3;
  procedure go2 is begin
    go3(DATE'2004-12-26');
    go3(DATE'2005-12-25');
    go3(DATE'2006-12-24');
    go3(DATE'2007-12-30');
    go3(DATE'2008-12-28');
    go3(DATE'2009-12-27');
  end go2;
  procedure go(T varchar2) is begin
    execute immediate('alter session set nls_territory='''||T||'''');
    S := TO_CHAR(TO_DATE('07/20/2008','MM/dd/YYYY'),'D'); -- sunday, July 20, 2008
    M := TO_CHAR(TO_DATE('07/21/2008','MM/dd/YYYY'),'D'); -- Monday, July 21, 2008
    DBMS_Output.Put_Line('  '||S ||'   '||M||'   '||rpad(T,16) );
    go2;
  End go;
Begin
  DBMS_Output.Put_Line(chr(10)||' Sun Mon Territory' || chr(10)||' --- --- -----------');
  Go('UNITED KINGDOM');
  Go('MOROCCO');
  Go('BANGLADESH');
  Go('AMERICA');
End;
/

Similar Messages

  • Changing first day of week in Calendar help

    Hi,
    I want to change the first day of week from Monday to Sunday in Webdynpro ABAP screen's default calendar help. I implemented BADI CALENDAR_DEFINITION to change the first day of week, it worked for SAP GUI calendar help but not working for WebDynpro ABAP screen.
    Thanks,
    Alok

    Hi,
    Try using the data type TVDIR-GENDATE for date field. It will populate serach help Calendar and it should trigger the BADI from web dynpro also.
    Refer SAP Help. It is pointing to the same BADI.
    http://help.sap.com/saphelp_nwpi711/helpdata/en/3d/e53642e2a3ab04e10000000a1550b0/frameset.htm
    Thanks,
    Jyothi

  • Calendar.app not showing First Day of Week selected in iCal

    I have selected Monday as the first day of the week in iCal. After syncing, Calendar.app on my iPhone 4 does not show Monday as first day of week. My original iPhone 2G (3.1.3, jailbroken) does show the correct start day, Monday.)
    I do not need assistance with my iPhone 2G. I need a solution for my iPhone 4.
    How do I get my iPhone 4 to be in sync with my other calendars?

    That's a real pain. I'm in Australia and the regional settings have Monday as the first week, which throws me out because all my calendars and even settings in iCal have Sunday as the first day of the week (which is what it's supposed to be). To get what I want, I have to set my country as New Zealand, and this messes up my phone number formats (closest to Australia than any of the others that start the week correctly though). It should be an option in the settings!

  • First day of week in Clock app - Alarm

    I changed the first day of week to Monday in Settings -> Mail, Contacts, Calendars -> Start Week On. However, it still shows Sunday as the first day in Clock -> Alarm -> Repeat -> Weekdays. How can I set Monday in the Clock app? Thanks.

    On 2/13/2013 12:36 AM, thgeiger wrote:
    >
    > Hi,
    > after upgrading from GW8.02 to GW2012SP1 the first day of week in
    > WebAcc and CalPub is Sunday again. Under GW8.02 I had configured the
    > first day as Monday (in a configuration file) Unfortunately I don't
    > remember which file it was?
    > Any ideas?
    > Kind regards,
    > Thomas
    >
    >
    Here's an old post, don't have time to confirm still true
    'm been looking around and trying to find out about the function
    "firstDayOfWeek", but I now finally found out it is much easier than that.
    Solution:
    Find the CssResources_xx.properties file (where xx is the language you
    want to change for) in the
    tomcat\4\webapps\gw\WEB-INF\classes\com\novell\webaccess\templates\css
    directory.
    Look for Calendar.Week.startDay=1 and change that to 2 for Monday. Do
    this for all language properties files you need.
    Stop and start tomcat and voil*.
    Regards,
    Patrick

  • First Day of Week in Data Entry Profile

    Does anyone know if there is a standard SAP RFC i can use in my Web Dynpro application to get the First Day of Week entry in a user's Data Entry Profile?
    Thanks,
    -Kevin

    Hello Kevin,
    Function Module returns the System Date from that SAP System(R/3). I have checked this BAPI with '200743 - current week' GET_WEEK_INFO_BASED_ON_DATE, it returns proper data like Start Date and End Date.
    I Assume, you are using this in your Java WD. You can write your own function for this. This will return the day of the week.
    Calendar xmas = new GregorianCalendar(2007, Calendar.SEPTEMBER, 23);
    int dayOfWeek = xmas.get(Calendar.DAY_OF_WEEK);
    wdComponentAPI.getMessageManager().reportSuccess("Day : "+dayOfWeek);
    Note : - week starts with 0 . 0 - Monday 6 -Saturday.
    Regards,
    Sridhar

  • First day of week in WebAccess and CalendarPublisher

    Hi,
    after upgrading from GW8.02 to GW2012SP1 the first day of week in WebAcc and CalPub is Sunday again. Under GW8.02 I had configured the first day as Monday (in a configuration file) Unfortunately I don't remember which file it was?
    Any ideas?
    Kind regards,
    Thomas

    On 2/13/2013 12:36 AM, thgeiger wrote:
    >
    > Hi,
    > after upgrading from GW8.02 to GW2012SP1 the first day of week in
    > WebAcc and CalPub is Sunday again. Under GW8.02 I had configured the
    > first day as Monday (in a configuration file) Unfortunately I don't
    > remember which file it was?
    > Any ideas?
    > Kind regards,
    > Thomas
    >
    >
    Here's an old post, don't have time to confirm still true
    'm been looking around and trying to find out about the function
    "firstDayOfWeek", but I now finally found out it is much easier than that.
    Solution:
    Find the CssResources_xx.properties file (where xx is the language you
    want to change for) in the
    tomcat\4\webapps\gw\WEB-INF\classes\com\novell\webaccess\templates\css
    directory.
    Look for Calendar.Week.startDay=1 and change that to 2 for Monday. Do
    this for all language properties files you need.
    Stop and start tomcat and voil*.
    Regards,
    Patrick

  • First Day of Week in Gnome Calendar

    One day I noticed that the first day of the week in my gnome calendar is was Monday instead of Sunday.  I have no idea what caused this change, but nothing I can do seems to be able to change it to Sunday.  This is the mini Calendar that pops up when you click on the clock on the panel.  any ideas?

    On 2/13/2013 12:36 AM, thgeiger wrote:
    >
    > Hi,
    > after upgrading from GW8.02 to GW2012SP1 the first day of week in
    > WebAcc and CalPub is Sunday again. Under GW8.02 I had configured the
    > first day as Monday (in a configuration file) Unfortunately I don't
    > remember which file it was?
    > Any ideas?
    > Kind regards,
    > Thomas
    >
    >
    Here's an old post, don't have time to confirm still true
    'm been looking around and trying to find out about the function
    "firstDayOfWeek", but I now finally found out it is much easier than that.
    Solution:
    Find the CssResources_xx.properties file (where xx is the language you
    want to change for) in the
    tomcat\4\webapps\gw\WEB-INF\classes\com\novell\webaccess\templates\css
    directory.
    Look for Calendar.Week.startDay=1 and change that to 2 for Monday. Do
    this for all language properties files you need.
    Stop and start tomcat and voil*.
    Regards,
    Patrick

  • CRM onDemand Calendar - Configure First Day of Week?

    Hi guys,
    by default, the calendar is showing Sunday as the first day of week in the CRM calenadr. is it possible to configure any settings to have monday as the first day?

    Mika, at this time it is not possible to configure the first day of the week.

  • SelectInputDate set first day of week

    Hi all! I was trying to change the first day of week showed in the calendar (Ex. set the first day the Monday) but i dont find any results :(
    Someone know how to change it?
    Many thanks.
    Jose.

    Hi Jose, <br>
    <br>
    Unfortunately, this is not possible in JDeveloper 10.1.3<br>
    See "<a href="http://blogs.oracle.com/Didier/2007/02/26#a218"> Setting the First Day of the Week to Monday in the SelectInputDate component</a>" for more details. <br>
    <br>
    Regards, <br>
    <br>
    Didier.<br>
    <br>

  • ESS: Change First Day of Week in Date Navigator

    G'day everyone,
    We are on NW2004S, i.e. ECC6 + EP7 + ESS 1.0. I'm having a hard time getting the Date Navigator, i.e. the value help for date fields in ESS, to use Monday rather than Sunday as first day of the week.
    I have managed to customise the Team Calendar (and the other calendars in ESS) to start on Monday rather than Sunday by changing the FirstDayOfWeek property of the calendar element using <Ctrl>-right-mouse-click in Portal Content administration, so that displays ok now.
    However, trying to do the same for the date navigator, i.e. doing a <Ctrl>-right-mouse-click just makes the date navigator disappear (actually it happens the moment I press the <Ctrl> key).
    Am I doing something wrong here? Is there any other way to customise the FirstDayOfWeek property of the Date Navigator of WebDynpro for JAVA iViews in EP7?
    Thanks a lot for your help and best regards!
    Andree

    On 2/13/2013 12:36 AM, thgeiger wrote:
    >
    > Hi,
    > after upgrading from GW8.02 to GW2012SP1 the first day of week in
    > WebAcc and CalPub is Sunday again. Under GW8.02 I had configured the
    > first day as Monday (in a configuration file) Unfortunately I don't
    > remember which file it was?
    > Any ideas?
    > Kind regards,
    > Thomas
    >
    >
    Here's an old post, don't have time to confirm still true
    'm been looking around and trying to find out about the function
    "firstDayOfWeek", but I now finally found out it is much easier than that.
    Solution:
    Find the CssResources_xx.properties file (where xx is the language you
    want to change for) in the
    tomcat\4\webapps\gw\WEB-INF\classes\com\novell\webaccess\templates\css
    directory.
    Look for Calendar.Week.startDay=1 and change that to 2 for Monday. Do
    this for all language properties files you need.
    Stop and start tomcat and voil*.
    Regards,
    Patrick

  • Deriving first day of week ww in year yyyy

    I need to be able to display the first day of a particular week in addition to the 'week-of-year' and year; for example:
    select to_char("ServiceDate",'yyyy-ww') as "Year/Week", sum("Points") as "Points"
    from my_table
    group by to_char("ServiceDate",'yyyy-ww')
    order by to_char("ServiceDate",'yyyy-ww')will give me the following:
    Year/Week     Points
    2008-33            1                     
    2008-35            1                     
    2008-42            4                     
    2008-43            2                     
    2009-01            1                     
    ...and so forth. What I would like to add to the dataset is the actual day that is the first day of the week for that Week/Year. For example, the first row would look like this:
    Year/Week     1st day of week     Points
    2008-33          08-AUG-2008*         1*Or whatever the first day of week 33 of year 2008 is (assuming 'first day of week' is a Sunday, for my purposes).
    My brain is on 'dim' right now; any and all assistance is greatly appreciated.
    Thanks in advance,
    Carl

    select  to_char(trunc("ServiceDate",'ww'),'yyyy-ww') as "Year/Week",
            to_char(trunc("ServiceDate",'ww'),'DD-MON-YYYY') "Week Start Date",
            sum("Points") as "Points"
    from my_table
    group by trunc("ServiceDate",'ww')
    order by trunc("ServiceDate",'ww')
    /SY.

  • Function Modules to get First day of week, month, Year

    Can anyone name the Function Modules for getting First day of week, month ,year.

    to get first day of week use this function;   WEEK_GET_FIRST_DAY
          CALL FUNCTION 'WEEK_GET_FIRST_DAY'
               EXPORTING
                    WEEK         = '201107'
               IMPORTING
                    DATE         = l_date
               EXCEPTIONS
                    WEEK_INVALID = 1
                    OTHERS       = 2.
    with DATE_COMPUTE_DAY function you can get date number in week.
    CALL FUNCTION 'DATE_COMPUTE_DAY'
           EXPORTING
                DATE = workdate
           IMPORTING
                DAY  = day_of_week_num
           EXCEPTIONS
                OTHERS  = 8.
      CASE day_of_week_num.
        WHEN 1.
          hold_day_of_week = 'Monday'.
        WHEN 2.
          hold_day_of_week = 'Tuesday'.
        WHEN 3.
          hold_day_of_week = 'Wednesday'.
        WHEN 4.
          hold_day_of_week = 'Thursday'.
        WHEN 5.
          hold_day_of_week = 'Friday'.
        WHEN 6.
          hold_day_of_week = 'Saturday'.
        WHEN 7.
          hold_day_of_week = 'Sunday'.
        WHEN OTHERS.
          hold_day_of_week = 'invalid'.
      ENDCASE.

  • First Day of Week

    Hi Guys,
    In a class I have an object which shows the date when a transaction was triggered and another object which gives the week number in the format wwyyyy.
    I want to create a variable in the report which will give me the starting day for that particular week i.e the date that was there on Monday of that particular week.
    It can be easily done by making changes in the Universe but I want to do it in the report as this is a one of report.
    Cheers,
    Shazin

    Guys,
    I have devised a method for the below and we can easily find out the week numbers of the month as below:
    Week Numb:
    =Week([WO's Last Month ].[Submit Date])
    First Day of the Month:
    =Week(RelativeDate(LastDayOfMonth(RelativeDate(LastDayOfMonth(CurrentDate());-65));1))
    Week Numb of the Month:
    =Concatenation("Week : ";([Week Numb - WO's Last Month]-[Last Day - WO's Last Month])+1)
    Please let me know if in case any queries.
    Cheers,
    Shaz

  • Date/locale problems; first day of week / browser language

    Hi,
    I've been trying to create an event calendar PL/SQL portlet. My problem is that it reacts to browser language or something, so it goes all screwy when viewed with browsers in another language.
    How can I force my portlet to be finnish and finnish ONLY. I DO NOT want it to change (first day of the week monday or sunday) depending on what browser the user is using. I have tried to use the third parameter to to_char(p_date, 'dd.mm.yyyy','NLS_DATE_LANGUAGE = Finnish') in all places but it has no effect. Database locale is correct ( I think, I'm not the admin) but still it happens. Chrome, Firefox, IE show different stuff depending on the browser language.
    I'll admit it is not the most elegant coding ever (if it were I would have taken this into account and dealt with it!) but is there any way to just force my dates and date variabes to be finnish, period.
    Edited by: Baguette on Mar 9, 2010 10:37 AM

    Got it.
    For public sessions, Portal will indeed investigate the browser language. Pending on the browser language, Portal can display in specific languages. Only when users login and set a language explicitly, will we maintain the language setting, unless the user switches browsers again.
    The Portal DAD settings will indeed overwrite your system wide setting of NLS_TERRITORY. The dads.conf will have something like AMERICAN_AMERICA.UTF8. If you want to overrule this in your portlet, you need to find a way of overruling the NLS_TERRITORY in the session. This can be done with dbms_session.set_nls('nls_territory','FINLAND');
    e.g. for my previous example :
    declare
    date1 varchar2(2000);
    date2 varchar2(2000);
    date3 varchar2(2000);
    begin
    select to_char(sysdate,'Dy DD-Mon-YYYY') today into date1 from dual ;
    select to_char(sysdate+ (1-to_char(sysdate,'D')),'Dy DD-Mon-YYYY') into date2 from dual ;
    select to_char(sysdate+ (7-to_char(sysdate,'D')),'Dy DD-Mon-YYYY') into date3 from dual ;
    htp.p('Territory set to AMERICAN');
    htp.hr;
    htp.p('Today : '||date1);
    htp.br;
    htp.p('First day of the week : '||date2);
    htp.br;
    htp.p('Last day of the week : '||date3);
    htp.br;
    htp.p('Territory set to FINLAND');
    htp.hr ;
    dbms_session.set_nls('nls_territory','FINLAND');
    select to_char(sysdate,'Dy DD-Mon-YYYY') today into date1 from dual ;
    select to_char(sysdate+ (1-to_char(sysdate,'D')),'Dy DD-Mon-YYYY') into date2 from dual ;
    select to_char(sysdate+ (7-to_char(sysdate,'D')),'Dy DD-Mon-YYYY') into date3 from dual ;
    htp.hr;
    htp.p('Today : '||date1);
    htp.br;
    htp.p('First day of the week : '||date2);
    htp.br;
    htp.p('Last day of the week : '||date3);
    end;
    Thanks,
    EJ

  • VBA script for custom Outlook 2010 calendar "first day of week"

    I need Outlook 2010 to use "week starting with the Saturday before Jan 1" as "first week of year" to match our company payroll calendar. (For example, Saturday 12/26/2015-Sunday 1/3/2016 would be "first week of 2016".) Is there
    a way to do this in a VBA script?
    -Thanks, zogg

    Hello zogg,
    The settings are stored in the registry at
    HKCU\Software\Microsoft\Office\15.0\Outlook\Options\Calendar
    where 15.0 stands for Outlook
    2013.
    Make changes in
    the Outlook settings and see which registry values change and in what way depending
    on the settings you change. 
    Also take a look at the How
    can I get the work week and day number in VBA (outlook 2010)? page which states the following:
    WW = Format(Now, "ww") & "." & Weekday(Now, vbMonday)
    The "Format" function returns an expression from a string formatted with the provided "format" argument (ww in
    this case, which returns the week of the year) and the Weekday() function
    returns the numbered day of the week where the first day is a VBDayOfWeek enumeration
    provided as the second argument (vbMonday in
    this case).

Maybe you are looking for

  • Using case statement in OWB expression builder

    Hi All, We are using OWB version 10.2.0.1.0. While using the below case statement We are getting the validation message as 'The expression is not properly formed'. Case statement used in expression builder: case when (INGRP1.CHARGETYPE in ('O','F') o

  • Trusted function help

    Hi all, I need to clarify if i am looking in the right place! I have a form with templates, when the first page is signed there is a button to create a second page from a template (with a new signature). I get this error: NotAllowedError: Security se

  • Upload pictures directly from Bridge to Flickr or other photo sharing site.

    Upload pictures directly from Bridge to Flickr or other photo sharing site. But flickr is the most important. Many people are searching for a plugin or patch or something to be able to this. Because of that many people are using Picasa because you ca

  • Is it just me, or has Verizon's CS taken a dive?

    Can someone please tell me why I now have to pay $30 dollars to upgrade my phone with Verizon? I'm already going to commit to two more years with you and you want to charge me to upgrade my phone from the one that is shaddered and barely usable, that

  • Desktop oddities when trashing file or folder

    Okay, this isn't a big deal, but it disturbs my normal way of using the computer. When I press Command-Delete for a file or folder I've selected on the Desktop it moves it to the trash. However THEN the Finder selects the "next" file or folder on the