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

Similar Messages

  • How can I find a photo from the backup file in my pc?

    How can I find a photo from the backup file in my pc?
    I have accidentally erased a photo. It happened after the backup.

    I am not aware you can extract a single photo or a single app's content from the backup, you can either restore the whole backup to your phone or not restore. If you restore your last backup to your phone then any content that is currently on your phone will be replaced with what was on it at the time that the backup was made - so if you do decide to restore, first copy off any purchases to your computer's iTunes via File > Transfer Purchases, and copy any documents/files that you've udpated on the phone since the backup.

  • How can i find my iphone from my mac computer

    how can I find my iphone from my mac

    i lost my iphone..I had find my iphone installed on it prior...
    how could i locate from my mac computer

  • How can I find the index from a specific container?

    How can I find the index from a specific container?
    For example, if I'm traversing through textframes like so (an example, not tested):
    var doc = app.activeDocument;
    var story = doc.pages[0].textFrames[0].parentStory;
    for (var i=0, l=story.textContainers.length; i<l; i++) {
         var textFrame = story.textContainers[i];
         if (textFrame.constructor.name == "TextFrame") {
              var lastPara = textFrame.paragraphs.lastItem();        //How can I find the index of this in relation to the story?
    How can I find the index of "lastPara" in relation to the story rather than the current container?
    I tried:
    var newPara = story.paragraphs[lastPara.index];
    but this results in an invalid object. . .
    alert(newPara.isValid);      //returns false

    The .index property is the character offset. So lastPara will begin at story.characters[lastPara.index].

  • Why I can only download 20 photos for last month from the photostream while I have more than 3GB photos kept in iCloud? Many thanks.

    Why I can only download 20 photos for last month from the photostream while I have more than 3GB photos kept in iCloud? My iPhone was stolen and the photos in it are very precious to me. Many thanks.

    On a new device you can only download what is currently stored in "My Photo Stream" in iCloud. iCloud keeps up to the last 1000 photos, but only the photos, that have been added during the last month. Older photos may be removed, when the time is up. On other devices you may be seeing older photos as well in "My Photo Stream", that will depend on the available storage on those devices, and when the Photo Stream has been enabled on those devices, see:  My Photo Stream FAQ - Apple Support
    If you are seeing other photos in the Photo Stream on other devices, that you want to save, mail them to you from the other devices.
    Have you tried to restore your iPhone from the last iCloud backup of the old phone? The backup will contain the photos in the Camera Roll, but not the photos in Photo Stream.   iOS: Back up and restore your iOS device with iCloud or iTunes

  • How do i find new downloads from i tunes in my video app in this os7

    How do i find new downloads from i tunes in my video app in this os7. All purchsed items are there, what a
    mess???

    Leonard,
    I used the sample code from StamperUI.cpp as a starting point. I have tried 'LoadBitmap', 'LoadCursor' and 'LoadIcon' and none of these seam to work for me.
    As I stated before, I used Visual Studio to create the icons in the resource file, so I would think that they would be recognized by the application.
    Thanks,
    Gregory

  • Can't find last import from iPhone! Noticed as I imported I had that view where there was only one project symbol, not all my projects showing by date, but even so pictures were imported. It took the time to do them, so where

    Can't find last import from iPhone!
    Noticed as I imported I had that view where there was only one project symbol, not all my projects showing by date, but even so pictures were imported. It took the time to do them, so where aare they? I have closed and restarted to get back fll view of all dated projects, but nothing can be found from today...

    have i posted it right...??  no response from apple guys...

  • How can I find 0YEA_QUA_MON_DAY hierarchy from 0CALDAY in RSA1?

    Dear expert,
    How can I find 0YEA_QUA_MON_DAY hierarchy from 0CALDAY in RSA1? or any t-code?
    i've try RSH1, but not found.
    Megan Wu

    Dear expert,
    How can I find 0YEA_QUA_MON_DAY hierarchy from 0CALDAY in RSA1? or any t-code?
    i've try RSH1, but not found.
    Megan Wu

  • HT3275 How do I find/restore files from items in secure home folder? How do I find/restore files that crashed when in finder of secure (File Vault) home folder?

    How do I find/restore files from items in secure (File Vault) home folder? How do I find/restore files that crashed when in finder of secure (File Vault) home folder?  When I go into Time Machine, I see earlier dates but can't see files in my User File. I have File Vault turned on and see my home folder as a sparsebundle.  Do I neede to restore this in order to see files in my home folder.  When I click on it to restore it gives me an estimated time of over 2 hours.  Also tried to restore an Excel file I was working on when computer hung, so lost it without saving or naming it.  Does it exist anyplace and can I restore it?

    Thanks. I had pretty much figured out from other posts that I had better turn off File Vault for my home folder and use a disk utility sparse bundel for little information I wanted to secure. The information about File Vault 2 in Lion was new and useful though.

  • How do I find the IMEI from my stolen iPhone 5? I have only the Serial number on the receipt.

    How do I find the IMEI from my stolen iPhone 5? I have only the Serial number on the receipt.

    Follow the most appropriate option here: http://support.apple.com/kb/HT4061

  • HT4623 how can I find my iphone from my pc

    how can I find my iphone from my pc?

    Yes, the problem is NOT the iOS itself.
    When you connect to iTunes, can you make a picture of the "summary" page bottom: the iPhone memory line and post that here?

  • How to get the current week from sysdate?

    Hi sir,
    i want to know how to get the current week from sysdate?
    thanks

    Hi Nicolas
    It seems you like to check my post and also make commend ;) thanks for your attention
    Have you ever read the posts above and given solutions ?Yes, I did
    Have you read the docs ? Yes, I checked
    What's the added value here ?Did youYou shared doc with solution(long one), I shared short one which point same solution(Check what Joel posted)..So what is benefit, As you can guess oracle docs are sometimes become so complicated as specialy for beginner...(At least it was like that for me and Belive me somedocs are still sooo complicated even for oracle coworkers ) But for you I dont know ;)
    => Why writting the PS in bold ?Why.. Let me think... Ohh Maybe I am looking some questions(many) and even user get answer they should not changed status so I am reading some posts and try to get problem and loosing time..
    So I am putting that PS wiht BOLD because I dont wanna lose time my friend ;) Because While I am trying to help ppl here In same time I am trying to giving support to my customer prod systems. Which mean time is very important for me...
    Hope my answer could satisfy you..
    One important PS for you.. You may not like my posts (or someone) but my friend I become tired to read&answer and make commend to on your comment which is about my posts.
    I am not newbie in forum(At least I fell like that) and I belive I know how I should make post..
    Thank you
    Regards
    Helios

  • 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

  • How can I retrieve last month and last mont -1?

    Hi guys, I am finishing to build a complex SSIS package, the last task is pretty simple but I'd like you to suggest the better solution in terms of performance (table with millions rows). The task is to create two table, one with the last update (archived)
    and one with the last update -1 (the update is done monthly) taking the data from an huge table (create by the package).
    The DDL (sample):
    create table forum (runner varchar(20), race varchar(20), nmonth varchar (6), archived datetime2)
    insert into forum values ('Zabres','Poland Red Bull','201411','2015-01-26 11:37:02.6870000'),
    ('Reynolds','Poland Red Bull','201411','2015-01-26 11:36:02.6870000'),
    ('Greefer','Poland Red Bull','201411','2015-01-26 11:38:04.6870000'),
    ('Zabres','France Red Bull','201411','2015-01-26 11:38:10.6870000'),
    ('Reynolds','France Red Bull','201411','2015-01-26 11:36:02.6870000'),
    ('Greefer','France Red Bull','201411','2015-01-26 11:36:02.6870000'),
    ('Zabres','Poland Red Bull','201411','2014-12-31 16:22:02.6870000'),
    ('Reynolds','Poland Red Bull','201411','2014-12-31 16:26:02.6870000'),
    ('Greefer','Poland Red Bull','201411','2014-12-31 16:26:14.6870000'),
    ('Zabres','France Red Bull','201411','2014-12-31 16:22:02.6870000'),
    ('Reynolds','France Red Bull','201411','2014-12-31 16:22:02.6870000'),
    ('Greefer','France Red Bull','201411','2014-12-31 16:22:02.6870000'),
    ('Zabres','Poland Red Bull','201411','2014-12-11 10:30:14.5870000'),
    ('Reynolds','Poland Red Bull','201411','2014-12-11 10:31:10.5550000'),
    ('Greefer','Poland Red Bull','201411','2014-12-11 10:31:14.3560000'),
    ('Zabres','Poland Red Bull','201411','2014-12-11 9:11:14.4420000'),
    ('Reynolds','Poland Red Bull','201411','2014-12-11 9:11:54.7760000'),
    ('Greefer','Poland Red Bull','201411','2014-12-11 9:11:55.7860000')
    The tough thing is the format of archived. How can I take the last month and, especially, the last month -1 without caring about the seconds and milliseconds ?
    The expected is LAST MONTH
    LAST MONTH -1
    Many thanks in advance

    Yes! Your solution looks better, even in terms of performance (242 sec mine, 202 sec yours). Now I'm wondering the same, shall I upload the elements only once per month? What if I got more upload in one month?
    You can also upload it once per week
    In which case query would be like
    SELECT *
    FROM forum
    WHERE archived >= DATEADD(wk,DATEDIFF(wk,0,GETDATE()),0)
    AND archived < DATEADD(wk,DATEDIFF(wk,0,GETDATE())+1,0)
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How can i retrive last matnr  from ekpo ?

    i want to find last price ( netpr ) from ekpo to Material Number (MATNR)
    i know how  to do so with internal table  ,
    sort the it table  by matnr ebeln ebelp and take the last line .
    but  is it possible to do so in the select , some how ?

    Hi,
    You can use SELECT statement with option ORDER BY.
    SELECT * UP TO 1 ROWS
    FROM EKPO
    WHERE MATNR EQ WA_MATNR
    ORDER BY MATNR EBELN EBELP ACSENDING
             NETPR DESCENDING.
    WRITE: / EKPO-NETPR.
    Hope this will help.
    Regards,
    Ferry Lianto

Maybe you are looking for