Select extract(month from sysdate)+6 = returns 13 and not 1(jan)

Hi
I am using the following query to get the month 6 months from now.
select extract(month from sysdate)+6
from dualHow can I say that the month should be 6 months from todays month? It worked all these days because this month + 6 was always a valid month. Now it returns 13.

When I run the following, I get '1'. I am expecting '01'. What am I doing wrong here?
SELECT substr(lpad(to_number(to_char(ADD_MONTHS(SYSDATE, 6),'MM')),2),1,2) FROM DUAL;
I need number - so using to_number. I need to extract the month, so using to_char. If someone could help me get 2 digits for the month and simplify the query if possible - would be great.
The table has month and date stored as number (bad idea I know but thats how it is). Now for January 31, it is stored as 131. For 15 Feb it is 215. What I need is give me records where the month is 6 months from now. Something like:
to_number(substr(lpad(tbl1.monthdt, 4, '0'), 1, 2)) in
substr(lpad(to_number(to_char(ADD_MONTHS(SYSDATE, 6),'MM')),2),1,2)Message was edited by:
bpel

Similar Messages

  • How to extract data from ORCL GL in "full" and not "delta " with FDM ERPI?

    Hi
    I am using FDM ERPI 11.1.2.1 to extrct data from Oracle eBS 11.
    I can see that FDM ERPI extracts data in "delta mode" using the GL_TRACK_BALANCES_DELTA (FDM adds a row in this table after the 1st load of the period").
    Is it possible to force the "full mode" in order to reload all the data from Oracle GL for each FDM data load?
    Because I don't know why, but I have each month rows which are not imported into FDM.
    thanks in advance for your help
    Fanny

    Hi
    I had see that I have to install the FDM 11.1.2.1.502 patch in order to see this option in my ERPI adapter options.
    I have passed this patch.
    So I have the ERPI-FIN-C1 adaptor.
    I can see a new option (Time Out Value) but no "Load Data" or "Execution mode" option :-(
    Any idea of where the problem come from?
    Fanny

  • Extract time from sysdate or some other?

    Dear all,
    I want to extract the Hour as a number from sysdate. Plz guide me.
    Ex: SELECT EXTRACT (YEAR FROM SYSDATE) FROM DUAL;
    I want like SELECT EXTRACT (Hour FROM SYSDATE) FROM DUAL;
    Thanks in Advance..

    you can use to_char function
    select to_char(sysdate, 'hh24') from dualor use a timestamp with extract function
    select systimestamp, extract(HOUR from systimestamp) from dual

  • Oracle - How  do i  find last 18 months from sysdate

    How do i find last 18 months from sysdate as Month Date and year (i.e MMDDYYY)

    SELECT to_char(sysdate,'MMDDYYYY') "Today", TO_CHAR(ADD_MONTHS(sysdate,-18), 'MMDDYYYY') "-18th Month" from dual;
    Today -18th Mo
    10212008 04212007

  • TS4036 Hi, I have recently upgraded from and Iphone 4 to 5.  I completed a back up on my iphone 4 via icloud which went ok.  When setting up my new phone I selected to set up as a new phone and not via icloud back up.  Is there anyway I can restore my det

    Hi, I have recently upgraded from and Iphone 4 to 5.  I completed a back up on my iphone 4 via icloud which went ok.  When setting up my new phone I selected to set up as a new phone and not via icloud back up.  Is there anyway I can restore my details to my new phone?  Thanks Hayley

    Welcome to the Apple Community.
    Navigate to Settings > General > Software Update and install any updates available.
    Navigate to Settings > General > Reset > Erase all contents and settings on the device you want to restore.
    When this completes and the Set-Up Assistant starts, choose "Restore from iCloud Backup" and enter your iCloud account and password. You will see the three most recent backups for each of the devices on which you enabled Backup. Choose which backup to restore from.

  • How can I select several emails from 3900 on my 5c and delete the rest easily

         How can I select several emails from 3900 on my 5c and delete the rest easily

    We'll I don't think there's a easy way to delete a lot of emails besides deleting all of them. To delete all of them click on inbox them edit then "mark all" then trash/delete. Other than that you will have to specifically deleted the ones you want to delete.

  • An Average of a Count erroneously returns integers and not decimals

    I have a table which holds sales information showing the invoice number and the branch (e.g. 'New York', 'Boston', etc..)  that sold the items. Each row represents a product on an invoice. I am trying to find out the average number of lines per invoice
    for each branch. So my final result set might tell me that the 'New York' invoices had an average of 2.4 lines per invoice and the 'Boston' invoices had an average of 1.9 lines per invoice. Like this:
    New York, 2.4
    Boston, 1.9
    I've first written a subquery that counts the number of lines for each BRANCH & INVOICE combination for any date after 1/1/2015. Then I've put a query around that subquery which averages this count by Branch. The problem is, the entire query is only
    returning integers and not decimals. Why is this?
    Note that I tried casting the data type to DECIMAL and FLOAT but still get the same results.
    Here is the query:
    Select t1.Branch, cast(avg(t1.Count) as numeric(10,2))
    as Avg_Lines
    from
    (Select Branch, invoice, count(*) as Count
     from linprm
     where invdte>20150101
     group by Branch, invoice) t1
     group by t1.Branch

    To expand Scott's answer:
    Select t1.Branch, avg(cast(t1.Count as numeric(10,2)))
    as Avg_Lines
    from
    (Select Branch, invoice, count(*) as Count
    from linprm
    where invdte>20150101
    group by Branch, invoice) t1
    group by t1.Branch
    -- or
    Select t1.Branch, cast(avg(t1.Count) as numeric(10,2))
    as Avg_Lines
    from
    (Select Branch, invoice, cast(count(*) as numeric(10,2)) as Count
    from linprm
    where invdte>20150101
    group by Branch, invoice) t1
    group by t1.Branch
    Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

  • My message always comes from my iCloud @me handle and not my other IM accounts when I send an IM? How to make it come from my @gmail account?

    My message always comes from my iCloud @me handle and not my other IM accounts when I send an IM? How to make it come from my @gmail account?

    Hi,
    As you have found in the View Menu of iChat is the option to Display the Recipients Bar
    This bar when clicked will display the Screen Names that you know for your Buddy and your own Screen Names.
    The Buddy's names are in the "To:-" section whilst your own are in the "From:-"
    Example pic from my iChat 6
    The Chat window has to Be Open.
    The Buddy's current name becomes a Drop Down that show the To and From names.
    It appears to allow you to Connect Google or Jabber IDs to AIM Buddies but the tick will move to any valid Account if you change either the To choice or the From choice.
    AS you say about the add Buddy drop down that appears - when your Buddy list are displayed as one an extra drop down appears fro you to Select the account/list it is joining as a Buddy
    8:17 PM      Wednesday; January 4, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • How do i keep only the name of a month in a cell in Numbers and not have it auto fill the date and time?

    how do i keep only the name of a month in a cell in Numbers and not have it auto fill the date and time?

    Hi JN and Barry,
    Barry wrote:
    The second case may not be included in the available D&T formats in Numbers 3
    For my region, the Date & Time data formats include month.
    The Date Pop-Up
    This may not be the case for all regions.
    Remember that the month is only the display, and the Full Date & Time is still there. If I change the format to reveal what is behind the curtain:
    Regards,
    Ian.

  • I upgraded from Iphone4 to Galaxy S4 and not receiving text messages from Iphones.

    I upgraded from Iphone4 to Galaxy S4 and not receiving text messages from Iphones.I went to https://supportprofile.apple.com/MySupportProfile.do and unregistered my old iPhone to resolve the issue. It's been one day and I cannot recieve text messages from Iphones

    Verizon wiping out old phones would have nothing to do with it. The phone is no longer associated with the number, so wiping the phone would have no effect. It is your Apple ID which is the problem. You have iMessage turned on for your Apple ID. iPhones which have your Apple ID associated with your contact will send texts to your Apple ID, not your phone #. If you have another Apple device which can use iMessage, you could turn off iMessage in that device, but as long as your friends have your Apple ID associated with your contact and you have turned on iMessage in an Apple device and never turned it off before switching from an Apple device to another platform, you will have this problem.
    You can bet that Apple will not address the problem, as they don't see it as a problem if someone is using a phone other than an iPhone. Apple expects no one will ever switch away from an iPhone once one has been used. Therefore, no problem for them to address.
    The problem lies with Apple wanting their users to go through yet another proprietary interface, iMessage, which the MAJORITY of all smartphone users do not have access.

  • How to extract data from a resultset returned by SQLX query

    Hi all,
    I'm doing a project in which I use SQLX query to extract data and format it into xml from an object-relational database, and return it to a windows application. But when the resultset is returned, I don't know how to extract and display the data from it. The datatype of returned data might be XmlType, but i don't know how to process it..Can anyone help? It's urgent.. Thanks a lot in advance...
    Joanne

    You can use XMLType.extract().

  • Get # of month from sysdate

    Hi all,
    I have a table name emp is defined as:
    ename varchar2(20),
    hiredate date,
    I want to display the employee name and calculate the number of months between today and the date the employee was hired. But I don't how to substract
    from sysdate with the hiredate to display the # of months.
    Please help
    Thanks in advance,
    JP

    You can use MONTHS_BETWEEN function. See
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/functions089.htm#i78039

  • How to extract month from given date in bpel??

    Hi friends hi need some information  regarding dates in BPEL.. Here in these I taking date as input which type is also date type.Then required output is month in number format.. Here I  used Assign activity and in assign activity,I took month-from-date and passed argument to this function.But it raised an error "internal Xpath error" Any one can you give me ideas please....

    First convert you date into datetime and then use the month-from-datetime function.
    Regards,
    Anshul

  • How to extract data from custom made Idoc that is not sent

    Hi experts,
    Could you please advise if there is a way how to extract data from custom made idoc (it collects a lot of data from different SAP tables)? Please note that this idoc is not sent as target system is not fully maintained.
    As by now, we would like to verify - what data is extracted now.
    Any help, would be appreciated!

    Hi,
    The fields that are given for each segment have their length given in EDSAPPL table. How you have to map is explained in below example.
    Suppose for segment1, EDSAPPL has 3 fields so below are entries
    SEGMENT          FIELDNAME           LENGTH
    SEGMENT1         FIELD1                   4
    SEGMENT1         FIELD2                   2
    SEGMENT1         FIELD3                   2
    Data in EDID4 would be as follows
    IDOC           SEGMENT                          APPLICATION DATA
    12345         SEGMENT1                        XYZ R Y
    When you are extracting data from these tables into your internal table, mapping has to be as follows:
    FIELD1 = APPLICATIONDATA+0(4)        to read first 4 characters of this field, because the first 4 characters in this field would belong to FIELD1
    Similarly,
    FIELD2 = APPLICATIONDATA+4(2).
    FIELD3 = APPLICATIONDATA+6(2).  
    FIELD1 would have XYZ, FIELD2 = R, FIELD3 = Y
    This would remain true in all cases. So all you need to do is identify which fields you want to extract, and simply code as above to extract the data from this table.
    Hope this was helpful in explaining how to derive the data.

  • Eyedropper selection from browser reads as #fefefe and not #ffffff?

    I've been able to in the past use the eyedroper tool to grab colors from browser windows and get the exact coded color if it's a css color. I'm using Photoshop cs5 on a mac with snow leopard. When I try to get any color from a browser window (both safari and firefox) photoshop will shift the color slightly. Anyone have any ideas as to why? Do I have setting that is wrong all of sudden?

    One more question. If I use a third party app like xScope to get recoil or reading, it reads exactly the right color from the browser. Why does this app behave as expected and not photoshop? It seems that if the color is coded at #ff0000 it should read as that. Photoshop reads this as as #fe0000. Whereas, xScope reads it at #ff0000. Is there any way to change a display setting or photoshop setting to get this to work?

Maybe you are looking for

  • Urgent help needed on writing errors in to windows application logs

    Hi all, we have web based application. Whenever there is critical errors encounters in our application we need to write that errors in to windows event viewer, application logs. Please help me on how to do this. do we have any specific API for this ?

  • PHP and MySQL issue {subject edited by moderator}

    Using Dreamweaver and PHP.   On one page, I have a form with an Insert Field (LastName) that enter into the SQL database. SQL database has the ID auto-increment.   When I click on Send (with the data entered into the database), I want the new page to

  • Final cut express to final cut pro x ?

    Is it possible to move my films from Final Cut Express to Final Cut Pro X ?

  • ZIP file attachment in DMS

    Hello All How to attach a ZIP file in DMS while creating document from CV01N transaction. I have tried this in CV01n & ZIP file is attached but after creating Document when I am go in CV02N transaction & tries to open the ZIP file attachement system

  • ESS link in Outlook express

    Hi friends My client wants when ever a workitem gets in the UWL a email has to notify that a workitem has come. I know that there is a report program RSWUWFML2 and configuration of this report with correct varient you can achieve it. I have followed