ORDER way week start from MONDAY [Mon...Sun]

Display the last name, hire date, and day of week on which the employee hire.
Order the result by the day of week starting with Monday.
(eg. Monday,Tuesday……Saturday,Sunday)
I have tried this using following statement…..But is this right way!? Any other command availabe for same.
SELECT last_name, hire_date, TO_CHAR(hire_date,'Day')
FROM employees
ORDER BY TO_CHAR(hire_date -1,'d') ;
[FROM  ORACLE University Introduction to Oracle9i: SQL Vol 1, Chapter 3, Q.10, PAGE NO 3-64]

i think i will also works
decode(to_char(hiredate,'d'),1,null,to_char(hiredate,'d'))This is very nls-dependant:
begin
  for cTerr in (select value from v$nls_valid_values where parameter = 'TERRITORY') loop
    begin
      dbms_session.set_nls('nls_territory', ''''||cTerr.value||'''');
      if to_char(to_date(7,'j'), 'd') not in (2) then -- Monday
        dbms_output.put_line(cTerr.value || '=' || to_char(to_date(7,'j'), 'd'));
      end if;
    exception
      when others then
        dbms_output.put_line(cTerr.value || '=?');
    end;
  end loop;
end;
/Look for example at BANGLADESH

Similar Messages

  • How can i set my calendar start from Monday NOT Sunday like it is now?

    How can i set my calendar start from Monday NOT Sunday like it is now?

    Read this thread: https://discussions.apple.com/message/11501621#11501621
    For example, if you set the Regional format to United Kingdom, the days will be re-ordered but it will have other effects as well which you probably don't want.

  • Calendar days to start from Monday to Sunday

    Guys,
    On the Calendar functionality, when viewing the appointments by week then is it possible to have the day to start from Monday to Sunday?
    Currently, it starts at Sunday to Saturday.

    At this time the calendar is set for Sunday to Saturday. I would recommend submitting a enhancement request to On Demand customer care.

  • Rollover 18 weeks starting from week number of current month

    Hi,
    I have a requirement as described below.
    Table Name Time:
    Columns: Fiscal Year, Fiscal Month and Fiscal Week
    above table has join with sales table and it contain sales data on week basis. so least granularity of data at week level.
    we have a report with columns fiscal year, actual sales and forcast sales. our requirement is to filter the data with following criteria.
    Current Month Filter
    Jan fiscal week between 1-18 of current year
    Feb fiscal week between 5-23 of current year
    March fiscal week between 9-27 of current year
    November fiscal week between week 44 of current year and week 10 of next year
    December
    so with above requirement we need to filter data with rollover 18 weeks starting from week number of current month
    I tried with timestampadd(sql_tsi_week, interval, week) but it's not working as I expacting. Please provide the code/logic to get it done.
    Appreciate your help.
    Thanks
    Jay.

    Jay wrote:
    I need to get rollover 18 week data at anypoint of time starting with week number of 1st of every month to 18 weeks. read my question again and you will be able to understand.You're kind of missing the point to be honest. It's very hard to answer specific questions without the required information. To answer a question like this we need a minimum of:
    1. Oracle version
    2. Sample data (CREATE TABLE / INSERT statements)
    3. Expected output
    4. Explanation of business rules.
    Alternatively, you can read the link in my original response.
    Please provide the required information and someone can help.

  • Calendar weeks start on monday

    is anyone else having weird small problems like my calendar week starts on monday (all my other calendars are set to start on sunday) and i cant find any setting on my phone to change this. also i'm not sure how long its been like this but i recently noticed my native weather app has an icon that says 23° and sunny. i'm pretty sure when i first got this phone t said 75° and sunny (y does it seems that i have a celsius icon when my degrees are set to fahrenheit? ) i guess this isnt a big deal, but little things keep adding up to make me think i have a less-than-perfect 16gb iphone (as in it actually works less well than my previous 8gig iphone).

    Man, I love the search function... lol
    I had to reset and reboot my iPhone and wondered why suddenly the Calendar was starting on Monday. Forgot all about this tip.
    Thanks Jim.

  • How to have a week start on monday on the IPhone ???

    I jus want to know how can I make my week start on monay not on sunday. On ICal the week start on monday.
    Thanks in advance

    That's based on Settings > General > International > Region Format. If set to United States, the week starts on Sunday; UK week starts on Monday.

  • Populate week number: week starts from saturday

    Hi All,
    We populated the calendar table where we have populated the week number (1-53) by taking sunday as the week start date.
    But we need to populate the weeknumber(1-53), with week start day as saturday.Please
    Here is the alredy populated data.
    Day WeekNumber Mon date
    Sunday     1     January     1/1/2012
    Monday 1 January 1/2/2012
    saturday 1 January 1/7/2012
    Sunday 2 January 1/8/2012
    we have to populate the weeknumber with saturay as the weekstart date
    Thanks All.

    Hmmm , after re-reading the OP's question I realise I have provided a comprehensive and well-researched answer to a different question. Must be getting over-excited, it being so close to Christmas. Anyway, I'm going to leave this answer up for the time being, until I can find a better home for it.
    The day number is a function of your NLS_TERRITORY setting, a parameter derived from NLS_LANG . For instance when the locale is 'AMERICAN' the first day of the week is SUNDAY but when the locale 'ENGLISH' it's MONDAY. It is possible to mix'n'match language and territory. [url http://docs.oracle.com/cd/B28359_01/server.111/b28298/ch3globenv.htm#i1007222]Find out more.
    So, if you set the NLS_TERRITORY to somewhere in the Islamic world, say Kuwait, you will find that Saturday is day 1 of the week. You can do this at the session level:
    sql> alter session set nls_territory = 'KUWAIT';
    Session altered.
    SQL> select to_char(sysdate+1, 'DAY') as day_name
       2            , to_char(sysdate+1, 'D') as day_no
       3    from dual;
    DAY_NAME  D
    SATURDAY  1Cheers, APC
    Edited by: APC on Dec 21, 2012 11:07 AM

  • Best way to move from msjava to sun java

    Hello Java people,
    We have a web version of a program, attachmate extra, (mainframe emulator), that requires Java 1.5 runtime applet. I have a package set up using the msi from java ready to be pushed with SMS. My goal is to have users using Sun java 1.5 as their default applet and I don't care if msjava is still left on the pc's.
    So here are my questions...
    1) Do we need to remove msjava or can we just install sun java 1.5?
    2) If we just install sun java 1.5 is this the command line to use for IE to use java 1.5 as it's default? msiexec.exe /i jre.msi IEXPLORER=1 (would that work?)
    3) Are there any procedures outlined anywhere on the best way to do this?
    Any help would be greatly appreciated as Java is a little foreign to me.
    Thanks!
    Bryan

    The differences in processors makes the migration not as easy and other posters have already given you good advice.
    I actually DID the G5 PPC Tiger to Leopard migration and after many (unsuccessful) attempts to achieve a stable Leopard by merely installing it "over" my Tiger volume, I ended up having to do the equivalent of "erase and install" (I simply bought a new harddrive disk [HDD] and installed a brandnew Leopard). Despite this, the IBM processor did not really "like" Leopard and repeated Kernel Panics (KP) started to occur resulting in loss of RAM and bus; too many issues having to run many programs under "rosetta". Also, some of the nicer features in Leopard (front row, bootcamp) did not work at all with the PPC architecture. Also Photoshop needed upgrading for Leopard and plugins need updates, too (check with Adobe and with e.g. Alien Skin)
    Having said that, I have heard of success stories of PPC and Leopard. (intersting article about "complexity of Tiger in a server": http://ls.berkeley.edu/mail/magnet/2008/0374.html might have a relevance to ordinary OS). So I am not trying to put you off, just giving you a first hand experience my own experience.
    I think you need to ask yourself:
    1) Is my machine not working satisfactorily? (If so, then why not try the upgrade)
    2) Why do I want Leopard (if you fancy a change, why not for it then)
    3) Is the upgrade essential? (It is nice to have something new, but you know, I do miss OS9, as that no longer works with Leopard unless you emulate with e.g. sheepshaver (see discussion:
    http://macosx.com/forums/mac-classic-system-software/296734-classic-os9-leopard. html)
    4) As always, there is always something "newer and better" (snow leopard: http://www.apple.com/macosx/snowleopard/)
    Good luck with your decisions
    NB: I am running Leopard with my Intel Mac Pro and am absolutely lunatic (=over the moon )
    Message was edited by: Alexandre

  • ICal print in weekly view doesn't begin from monday but tuesday

    Hello,
    I faced a problem while trying to print a weekly view of my calendars. Even though I have adjusted the calendar in the setting so that the week starts from monday, every time I try to print a weekly view of my calendars, the weekly view is is alway for the dates Tuesday - Monday, NOT Monday - Sunday. I tried choosing in the printing view that the printing would start from the date 27th of october (monday), but instead, the first date on output was always Tuesday (28th). The same happened when i chose that area printed starts from next week - it starts it again from Tuesday not Monday.
    Any help for this?

    epee91,
    What setting do you have in System Preferences...>Language & Region>First day of week:?

  • BI Query - Date Selction- week starts Tuesday

    Gurus,
    We have EP, BI ABAP and JAVA systems on Nw7. All end user executes queries trough EP.
    There are few BI queries where users need to enter date for execution of query.
    For execution of such query user is entering date using F4 (search).
    Select values for Calendar day (COMICAL 0003)--> Opens calendar and it is fine. Issue is week of this calendar starts with Tuesday.
    This behavior varies with workstations. Over few work station calendar week starts on Monday which is required.
    However over few workstations week starts on Tuesday.
    Any guess which property of work station needs to be tuned to have week starting from Monday.
    ps: I have checked Data and time setting of work stations and they are same.
    Thanks !!
    ARD

    Any luck over this vage issue....

  • Calendar starts from Sunday ...

    Hi folks,
    Currently the calendar in BI Publisher starts from Sunday. Is it possible and eventually how to change it as our week starts from Monday.
    Thanks in advance,
    Rossy

    Rossy
    Not in the current release - we are looking to release better control over calendars in an upcoming release.
    Regards
    Tim

  • Week starts monday

    Hi!
    In my country the week starts on monday and ends on sunday.
    Is there any way of making the calendar month view in my Iphone to behave that way?
    cheers,
    David

    My iphone's calendar, in month view, shows the week starting Monday. I didn't do anything to do this unfortunately - it just was. The only thing I can think is that the Settings->International part may have something to do with this? Mine is set to UK. My iCal settings are also set to display first day as Monday, but as someone else said - this doesn't seem to affect anything.

  • How to get week starting with sunday date

    Hi
    I have a date column "start_date", i need to create a report for all the weeks starting from sunday , for eg:
    i need to get week dates as :
    mm/dd/yy - 01/23/11 , 01/16/11 , 01/09/11 and so on...
    Please help
    Thanks...

    Hi,
    To find the last Sunday before or equal to start_date:
    SELECT     TRUNC ( start_date + 1
               , 'IW'
               ) - 1          AS week_start_date
    ...You can use an expression like this in a GROUP BY clause, also.
    This does not depend on you NLS settings. ISO weeks always start on Monday. Your week starts 1 day earlier, so that's why the expression above has the +1 and -1.
    (Depending on you NLS settings,
    SELECT     TRUNC ( start_date
               , 'D'
               )          AS week_start_date
    ...might do the same thing, but I still rocommend using 'IW'; a few extra keystrokes isn;t much to pay for a guarantee that it will always work.)
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data.

  • Split SNP planned order to weekly buckets

    Hi all,
    does anyone knows a way to split SNP planned order to weekly buckets from monthly buckets?
    the planner enters his production forecast in SNP94 in monthly buckets, but for purchasing prefer to see the demand weekly, i need an automatic split of planned order (something like the split of forecast).

    to split the component will not help, the need is to distribute the finish goods through the month on weekly buckets, once the finish goods are on weekly bucket, i don't care if the all the components demand is at the beginning of the period.
    i need a macro or heuristic to split the quantity, see the example below, the planner has monthly view in which he had entered 55,000 PC for month 10.2014, before i transfer this quantity to the ECC i need to split it to weekly buckets:
    simple MRP run will not work, because the planner may plan to produce more than the total demand.

  • I try to print my calendar (month view), but it starts on tuesday. I would like it to start on Monday.

    I try to print my calendar using the month view. The problem is that the first column start with Tuesday whereas I would like it to start with Monday. Any clues?
    Nota Bene: in my settings the week starts the Monday.
    Thanks a lot

    New bug introduced with Yosemite, I can't reproduce it on 10.9.5.
    The work around I found is to set the first day of the week as Sunday. Then you have a printed version of the week or month starting at Monday.

Maybe you are looking for

  • Error in installing SAP NetWeaver 2004s Java Trial Version

    I've got SAP Sneak Preview release SAP NetWeaver 04s SP9, for Java. I've tried to install, but failed miserably a couple of times. The error log is :- File system export (share) saploc does not exist. INFO 2006-11-01 17:03:42 Looking for SAP system i

  • What is the pixel or inches dimension to create a perfect sized wallpaper in Photoshop for the iPad air?

    I figured out by trying different sizes to make about a perfect sized wallpaper for the iPhone 5, but can't seem to make one for the iPad air. The dementions I used for the iPhone 5 was  1536x 894 pixels or (12.417 inches Wide x 21.333 inches Height)

  • Retrieving content from Apple TV

    Pretty sure I know the answer as others have posted similar questions but here goes: I bought a used Apple TV. The guy I bought it from does not have copies of any of the content (both iTunes purchased and non purchased (ripped etc.)) currently on th

  • Executing java in command prompt

    how can i execute java in cmd and log the result at the same time? as i'm hitting problem with the class that i remotely executed and do not know what happen at all :( thanks alot!!

  • Assign points to quiz slides using Question Pools Manager

    Is it possible to assign the points to be reported for a slide when using the Question Pools Manager? If one slide, for example, has 10 points, and another slide has 5 points, when they are both added to a question pool, do their loose their original