Numerical order (ORDER BY)`

I'm working on building reports in Microsoft SSRS using an Oracle source database and query. I'm trying to figure how to order the following output into numerical order in Oracle.
'0 - 3 Days', '4 - 8 Days', '9 - 13 Days', '14 - 18 Days', '19 - 23 Days', '24 - 28 Days', '> 28 Days'.

Or with the CASE in ORDER BY
WITH mydata(txt)
AS
   SELECT '0 - 3 Days'   FROM DUAL UNION ALL
   SELECT '4 - 8 Days'   FROM DUAL UNION ALL
   SELECT '24 - 28 Days' FROM DUAL UNION ALL
   SELECT '> 28 Days'    FROM DUAL UNION ALL
   SELECT '9 - 13 Days'  FROM DUAL UNION ALL
   SELECT '14 - 18 Days' FROM DUAL UNION ALL
   SELECT '19 - 23 Days' FROM DUAL UNION ALL
   SELECT '24 - 28 Days' FROM DUAL UNION ALL
   SELECT '> 28 Days'    FROM DUAL UNION ALL
   SELECT 'dummy'        FROM DUAL UNION ALL
   SELECT '24 - 28 Days' FROM DUAL UNION ALL
   SELECT '> 28 Days'    FROM DUAL UNION ALL
   SELECT '0 - 3 Days'   FROM DUAL UNION ALL
   SELECT '19 - 23 Days' FROM DUAL
SELECT txt
  FROM mydata
ORDER BY CASE txt
           WHEN '0 - 3 Days'
              THEN 1
           WHEN '4 - 8 Days'
              THEN 2
           WHEN '9 - 13 Days'
              THEN 3
           WHEN '14 - 18 Days'
              THEN 4
           WHEN '19 - 23 Days'
              THEN 5
           WHEN '24 - 28 Days'
              THEN 6
           WHEN '> 28 Days'
              THEN 7
           ELSE 0
        END;
TXT        
dummy      
0 - 3 Days 
0 - 3 Days 
4 - 8 Days 
9 - 13 Days
14 - 18 Days
19 - 23 Days
19 - 23 Days
24 - 28 Days
24 - 28 Days
24 - 28 Days
28 Days
28 Days
28 Days Regards.
Al

Similar Messages

  • I want to cancel the purchase order :Order Number: 13111072125, And I want to buy a Lightroom 5

    I want to cancel the purchase order :Order Number: 13111072125, And I want to buy a Lightroom 5

    Why is this difficult to cancel the purchase?, Many of the choices I do not know what a select? I can not deal with the difficulty of having a website to retrieve my money! ..
    This information can purchase everything that you ask !:
    Order Number: 13111072125
    Order Date: 04 October 2014
    Shipping Address
    tariq alkhabra
    hail ST20
    saudi arabia
    Hail 9666
    Saudi Arabia
    504355777
    [email protected]

  • Relation between CRM Order, Order Status by partner

    Hi,
    Can any one give me an idea to get Order, Order Status based on Partner in CRM.?
    Are there database tables or fm for that.? i can easily get them in R/3 but not in CRM.
    thanks,
    Macs.

    Pls let me close this.

  • Reservation list based on planned order / order( kkf6n)

    Hi
    How to get the list of reservations based on the planned order / order ( kkf6n ) for 1 year period. i am working in rem process.

    Dear Raj,
    Are you having the planned order for all the products for 1 year period?
    In my understanding even if planned order exists this may not be a firmed one and so why do you need the reservation list
    alone for all these planned order's?
    Check and revert back.
    Regards
    Mangalraj.S

  • I would like to cancel my order, order no: AD001440537EU. Products ordered: Adobe Export PDF, Annual.

    I would like to cancel my order, order no: AD00144537EU. Products ordered: Adobe Export PDF, Annual. What do I have to do?
    Regards,
    Lányi Péter Pálné (Mrs)

    You are at the wrong forum; this is the Reader one. In any case, this may be helpful: Cancel your membership or subscription | Acrobat.com online services

  • Configure Pring GR Slip to Customer return Orders (Order Type : RE)

    Dear Experts,
    Please help me out in below requirement.
    Customer return Orders (Order Type : RE) are entered and Goods Reciept done through Outbound Delivery.
    Now, how can I do the set up to rpint the GR slip (WE03)?
    I can see that it aleardy works fine for Goods recipet against a PO. But how is it done for Sales Orders?
    Also let me know can I use MB90 only to process the GR slip?
    Please guide me
    Regards,
    Shetty

    Hi,
    For GR based on SO, you cant use output type 'WE03' as it is different program that you use for doing GR based on PO.
    The output type that you should used is 'WABS'.
    Thanks.

  • GR Slip for Customer return Orders *(Order Type : RE)*

    Dear Experts,
    Please help me out in below requirement.
    Customer return Orders (Order Type : RE) are entered and Goods Reciept done through Outbound Delivery.
    Now, how can I do the set up to rpint the GR slip (WE03)?
    I can see that it aleardy works fine for Goods recipet against a PO. But how is it done for Sales Orders?
    Also let me know can I use MB90 only to process the GR slip?
    Please guide me
    Regards,
    Shetty

    you can  reprint the output in VL03N, check for the output types & reprint using issue output to.
    Rgds
    ilango

  • When importing numerical in order tracks some tracks are out of sequence

    When I import into iTunes my accompaniment CDs which have multiple tracks in numerical order, some tracks are out of sequence in the "Date Added" sort order.  This has been happening for quite sometimes with different versions and even on different computers.  This has got to be an iTune software glitch. I can click on sort Album and its ok.

    >> If syncing from iPhoto or Aperture on a Mac then they should sync across in the same order as in those programs.<<
    But they don't sync in the same order - All the photos in the album on iPhoto are automatically sorted in date/time order, ascending.
    When I sync the album to the iPad, POOF!, suddenly they're all mixed up in no apparent order.
    It does not make any sense to me at all.

  • Why won't my songs play in numerical tracks order?

    I have an album with about 30 songs on it, and some of those songs came from different sources. I changed all of the items on "Get Info" so that they would match, (album title, artist, album artist, composer, track number, disc number, compilation, etc) and although all of the information is correct, some of the songs are out of order. The album starts out with Track 1, but then it skips to Track 3. The rest of the album proceeds in numerical order for the most part, but Track 2, 15, 16, and 20 are all listed at the end of the album. If everything in Info checks out, why are some of the songs out of order?

    You will need to make sure that all the other relevant fields are completed and that those fields are accurate.
    total number of tracks on the album (as well as the track number):
    Artist name and album title are exactly the same - i.e. no extra spaces at the end of the name.
    If it is a Various Artists album, make sure that Part of a compilation is ticked and that the Album Artist has Various Artists in it, (See the above example).
    If none of the above sorts out the issue, check the Sorting tab and make sure the fields are correct.

  • How do I get multiple files to open in the same alpha-numeric sort order in which they are displayed in Finder?

    If I drag a bunch of files to, e.g., Adobe Photoshop they seem to open in strange orders. This makes automating any sort of editing workflow next to impossible. Is there some way to get programs to open files in the same order in which I see them? This is the default behaviour in Windows and it's really helpful when you have hundreds of files (or even just a few) that need to be processed in a certain order. Thanks for any help you might provide.

    You're welcome.
    What's likely happened is that when you transferred the video to the new machine they lost their dates.
    Photos use the Exif metadata to record the date and time of the shot. This is quite different from the date and time of the file, which can change as the file is copied from place to place. Video doesn't have Exif, and so iPhoto uses the file date, and that's changed.
    Simply, there's no absoultely reliable way to date video.
    Try assign dates with the Batch Change command under the Photos menu.

  • What is equivalent ASCP report for Planned Order&Order Reschedule Report

    What is equivalent report for Supply Chain Planned Order Report & Supply Chain Order Reschedule Report
    We are currently on MRP and running Supply Chain Planned Order Report successfully. We are planning to go to ASCP(Decentralized) next month ,what is the equivalent reports in ASCP?
    Edited by: SanDan on Jan 9, 2013 1:57 PM

    Hi ,
    You can explore the Planning Detail Report which you can run against your ascp plan. However there are few standard reports available in ascp. I suggest you can explore option of building custom report which will be best suited to your business needs (i.e. using Discoverer or if you are also implementing obiee you can build a custom report based on standard views or noitex views (- for ascp)
    Regards
    narendra

  • Issue in sales order order import program

    Hi all,
    I need to create a Sales Order using interface tables.First I inserted the record into the interface table OE_HEADERS_IFACE_ALL.I populated necessary columns in it.
    Then I executed Order Import Concurrent program giving value of order source(which I created using order import source setup),order reference(which is origSysDocumentRef column value in the above said interface table).
    But the concurrent program is not picking up the records in the interface table and its output shows no order to process.As a result no record is inserted in the OE_ORDER_HEADERS_ALL table.
    I dont understand where the problem lies.Please help me out to solve the issue.
    Thanks,
    goutam

    Hi Sandeep Gandhi,
    Thanks for your reply.
    Now Order Import Concurrent program picks up the header records from the OE_HEADERS_IFACE_ALL interface table successfully for processing.
    But during the process some errors are raised, and the error_flag in the header interface table is set to 'Y'.
    I want to know where can i find those errors,so that I can correct them.
    Is there any error log tables that contains these errors occured during import?
    Or we have any other way to identify it?
    Please help me..
    Thanks,
    goutam

  • Sales Order - order reason - cost element error in PO creation

    Good day Friends,
    We have a third party order scenario in our group among different company codes (FI-SD).   This scenario is working fine among the existing companies.
    Now there is a requirement from finance department to capture the revenues at different cost centers based on the order reason selected in the sales order.
    When order reason is mentioned in the sales order the system is giving error at the time of purchase order creation as u201CCreate account 123456 for 16.05.2010 as a cost element in controlling area INTu201D
    Where as if the sales order is created without order reason there is no problem in purchase order creation.
    Here the account 123456 cannot be created as cost element because it will stop the other existing processes in this controlling area.
    Thanks

    I can tell you why it's occurring and maybe give you a few suggestions on what to do.  The G/L account assignment for the third party sales process is determined based on the account key/modifier assigned to the transaction and the valuation class assigned to the material.  In this case, the account key/modifier is determined based on the account assignment category assigned to the purchased order (in the standard system the account assignment category is X for third party processing and the account modifier is VAX).  You would find the G/L account based on the combination of the account key = GBB, account modifier and valuation class using t-code (OBYC). 
    Saying all that, currently that combination is finding a G/L account that is not setup as a cost element (probably your cost of goods sold  account) and that's normal for these types of posting.  You can only make postings to cost centers for accounts that are setup as cost elements, so currently the system will not let make a posting to a cost center. 
    So if you want this transaction to post to a cost center, but don't want to create a cost element for this account, then you must use a different G/L account for these postings.  The simplest options would be to either change the account modifier assigned to the account assignment category or assign a different valuation class to these materials.  Once you've change one of those you can now assign a different G/L account to that combination in OBYC and create that account as a cost element.
    thanks,

  • PO (purchase order) order through app store school education

    Hi, does anyone know or have had experience with purchasing an app or two through the app store using a PO (purchase order)? I work for a school and my department is very adamant about running these POs (never knew what these were until I started working here). I have 2 apps that I want to use in place of adobe cc due to adobe not being able to do PO orders. I know such a hassle working for a school. But any help would be greatly appreciated. thank you.

    We are all users like yourself.  No one from Apple responds directly here (AFAIK).
    You might have luck buying volume...
    http://www.apple.com/education/it/vpp/
    Or see if your principal will let you purchase the apps on your own - print the receipt from iTunes for your credit card and ask for a reimbursement.
    Just don't buy the apps without approval - then you won't have a snowball's chance of getting reimbursed.
    Also
    From Apple
    How to Buy for Education
    If you are a student or teacher, visit the Apple Store for Education or call 1-800-692-7753.
    If you are buying on behalf of an educational institution, visit Apple Store for Education Institutions or call 1-800-800-2775, 7 days a week from 4:00 a.m. to 10:00 p.m. Pacific time.
    Or start here
    http://www.apple.com/contact/

  • Planned order to prod order----order type and prod version/ routing

    Hi,
    My client produces a material in three different locations. The process at all the locations is same. Each location has the set of same work centers. We have differentiated the workcenters at the three different locations by naming conventions. I am mainting three counters in the routing with different set of work centers.
    We want different order types for the production orders processed at these three locations. Also I should be in a position to select the routing/ production version manually for the production orders processed at the three different locations. When I am creating a production order manually, I can select the order type and even the routing or production version.
    But here I am converting the planned order to production order. The system is picking the order type as maintained in OPPE. In OPL8 I maintained manual  selection of prod version. But version 1 is selected default by the system. Can I have any control over the selection of order type and prod version/ routing?
    Thanks and Regards,
    Raghu

    Dear,
    Selection of production version is only possible at manual creation of production order, but not when converting planned order to production order. you can manually change the production version if u want to in the planned order.When you have a planned order it would default contain a valid production version. So system would just take the Production version in the planned order to use the same in Production order. If you want to change the production version in production order then go to CO02-FunctionRead PP Master data and change it.
    (Goto OPL8 and select Manual Selection of Production Order in Production Version field
    And in MRP4 view of material master select - Selection only by production version as the option for the Selection method field )
    Hope clear to you.
    Regards,
    R.Brahmankar

Maybe you are looking for

  • Changing the default "New Item" link url in SharePoint

    Is it possible to change the default url of the New Item button on a list. When i hover over or click on new item link it show the ......../15/listform.aspx?Page type=blah.....blah...... I want it to be something like :/newform?source=xxxx Please hel

  • Warning 20225 Adobe 6.0 Setup was unable .... on Windows Vista

    I'm trying to install Adobe Acrobat 6.0 on my Vista laptop but just before install finished this error message came up:  Warning 20225 Adobe Acroba 6.0 was unable to create a new item: Adobe PDF converter.  the Adobe PDF printer may be unavailable.  

  • Photos randomly out of order when published to my gallery!

    Photos are in the right order in iPhoto on my mac (Library, Albums, Web), but when the album is published to my gallery the photos are completely and randomly out of order. The name of each photo is just the number given by the camera, and iPhoto had

  • Is Ipad Mini unlocked

    I want to buy an Ipad Mini in the UK that has WiFi and Cellular but I want to be able to use the Cellular in South Africa, can this be done or do I have to get it unlocked.  Also if the Ipad Mini is unlocked is that the case no matter where you buy i

  • Force a Wsus client to check for updates

    Hi, we have a Wsus server and a GPO that forces all PCs and Servers to work with it. in the GPO, "configure automatic updates"  is configured to "notify for download and notify for install" and the "schedule install day" is tuesday. my question is, h