Generate yearmonth for every month of the year

Hi,
I need to generate all the dates in the format of yyyymm starting with the last month.
I mean something like below :
rownum            yearmonth
1                       201204
2                       201203
3                       201202
4                       201201
5                       201112
...I know we need to make of pseudo column LEVEL, but cant seem to make it work. Please advise.
Thanks
Billu

Thanks for responding.
marcusrangel -- I need to use the list of dates from the query for every cutoff that we have for comparision.
stew -- your query worked just fine.
Thanks

Similar Messages

  • HT3275 I've 1.85TB empty space on my time Machine, but it only backs up to the beginning of the previous month. it should have weekly back-ups for every month before that. Any ideas why it deletes stuff older than a month?

    I've 1.85TB empty space on my Time Machine, but it only retains back-ups to the beginning of the previous month. I should be able to access weekly back-ups for every month before that until the disk is full. Any ideas why it deletes stuff older than a month?
    Thanks, Rigby.

    If you are using Ethernet to connect your Mac to the Time Capsule, are you allowing at least 2-3 minutes for Time Machine to fully load when you open the application to see your backups?
    If you are using wireless to connect, you may need to allow 8-10 minutes or longer for everything to fully load, depending on the speed of your wireless connection.
    If you see only white time "bars" on the timeline at the right of the screen, you are seeing temporary backups. Permanent backups are displayed with purple "bars".

  • In ALV: Subtotals for every month, not for every day, possible?

    Hello,
    in my Alv-Grid I have a date column, which I want to use to generate subtotals. But I don't want to have a subtotal for every date, but for every month. Is there a method to accomplish this with subtotals? Thanks.
    Regards, Lars.

    Hi Stembergg,
    1. Its not possible with only date field.
    2. However, if you have one EXTRA FIELD
       which contains the Month
       only then it is possible.
      ( You may hide this extra field if   u don't
      won't to display. But anyhow, u need to
      modify your logic and the internal table
       and accordingly populate the extra field)
    3. There is contraint in alv
        that we cannot use any function for any column value
        for any claculation/grouping purpose.
    Hope it helps.
    Regards,
    Amit M.
    Message was edited by: Amit Mittal

  • Dyamic execution of report for every month and data through mail.

    Dear Friends,
    We are using ECC6.00 With EHP4. My requirement is to send the list of pending notifications with the list details as appearing in transaction QM10. Every month i am supposed to change the from date and to date for example 01.07.2010 to 31.07.2010 for the month July.
    How can i make system calculate the from and to date for every month and send mail.
    I can schedule the  job using SM36 but how to make system calculate the from and to date dynamically for every month. i.e., for august system should calculate date 01.08.2010 to 30.08.2010 automatically as the next month is reached.
    Experts help required.
    Regards,
    M.M

    1. You need to create a variant.
    2. In this blank out the date and give all the required values which will filter for the Pending nofitications like notificaiton type, status, etc.
    3. Then click save.
    4. When you click save it will give you an option to save as variant.
    5. Now in the Variant Attributes screen give the variant name/meanting
    6. In the below you will get a "objects for selection screen)
    7. In the same you will get the filed name calle d" notification date"/
    8. Here Move the curson to the righ side you will find the selection variable, change to D-Dyanamic date calcuation  and after that right side you will see one more column for the name of variable(input using only f4)
    9. Here press f4,
    10. then  ypou get a pop up for selection varaible. there first Put "I: for current date and also 'I" for hte Current date +/- ??? days
    in this give 30 days.
    11. You can also use other function her.e
    Now once the variant is created then you have to schedule a job for this program + variant in the sm36 and in the distribution list
    you need to mention the email
    check and let me know for the feedback
    reg
    dsk

  • Insert twelve MONTH of the year into table A_MONTH

    Could some help me with my simple SQL programming. Thanks
    -Kenny
    REM 2. Creates a table names fungue_table_ssss_nnnnnn with columns named A_Month, A_Date, A_Radius and A_Area.
    Create table fungues_table_1442_794485 (
    A_Month int,
    A_Day date,
    A_Radius number(9),
    A_Area number(4));
    REM 3. Enters records into the table by using loops, where A_Month is the month of the year, spelled out fully in capital letters, beginning with JANUARY and ending with DECEMBER.
    Declare
    Max_record constant number := 12;
    I number := 1;
    Begin
    For I in 1..Max_record loop
    Insert into fungues_table_1442_794485
    (A_Month)
    values
    (I, sysdate);
    end loop;
    commit;
    end;
    null

    SQLJ and JDBC are APIs for accessing the database from Java.
    So do not be surprised there are not too many many takers for a PL/SQL programming exercise here. Or, try rewriting it in Java :)

  • I am attempting to have cells use data from a selective month from the year before so that I can show actual from the prio. years each month.

    I am attempting to have cells use data from a selective month from the year before so that I can show actual from the prio. year each month. I need to create a spreedsheet using the the Acutlas from the year-to-date and from last year-to-date, but need to report each month.

    Hi Tony,
    Answering your question would be easier given a screen shot of the source table and one of what you want the summary table to look like.
    Is the data you want for each month in a single cell o the source table, or does the summary table need to collect February's data (for example) from several cells and do some math with those numbers before presenting them on the summary table?
    Regards,
    Barry

  • How to get the first month of the year inputed by user manually

    Hi Expert,
    Just like the subject, I 'd like to get the first month of the year inputed by user manually, but don't know how to set the variable, please help.
    For example, user execute a query and input the value of variable Year = 2010, and what I want to get is 201001 into another variable, so that I can use this variable to setup another selection.
    Thank you.
    Andy

    Hi Andy,
    1) U will create a user input varaible for year and say it is ZYEAR.
    2)  U will create another variable  for calmonth  which has processing type : customer exit ..single value ...mandatory ....say ZCMONTH.
    This needs to be populated using the year( user inputted )  and calmonth '001'
    This code will fetch the user input value into ZYEAR and append '001' to the user input value and the value
    will be passed to the ZCMONTH varaible...
    Sample Code is....
    When 'ZCMONTH'.
    IF I_STEP = 2.
         READ TABLE I_T_VAR_RANGE WITH KEY VNAM = 'ZYEAR'.
         IF SY_SUBRC = 0.
                    L_S_RANGE-LOW  =  I_T_VAR_RANGE-LOW.
                   L_S_RANGE-LOW+4(3) = '001'.
                  L_S_RANGE-SIGN = 'I'.
                 L_S_RANGE-OPT  = 'EQ'.
                      APPEND L_S_RANGE TO E_T_RANGE.
        ENDIF.
    ENDIF.
    Regards
    vamsi

  • Averaging Columns (by months of the year)

    Running Oracle 9i
    I have this query which takes fields: ID, Date, and Data and performs a crosstab (matrix) query which has the day column, the 12 months, and the total for each day.
    I have been trying to add averaging for each month at the bottom of the result and total after that so that the result looks like:
    Day Jan Feb Mar ... Oct Nov Dec Total
    1 1.1 2.2 3.3 4.4 5.5 6.6 999.99
    2
    30
    31 3.3 6.6
    (currently looks like the above.. Need to change query so that the next two lines are displayed)
    Average 2.2 4.4 ....... etc.. 5.5 (blank)
    Total 4.4 8.8........ etc... 11.0 999.99
    I tried to use an example of the ROLLUP and just got different errors..
    Here is the current query:
    select to_char(piDate,'dd') as day
    ,sum(decode(to_char(piDate,'mm'),'01',piValue)) as Jan
    ,sum(decode(to_char(piDate,'mm'),'02',piValue)) as Feb
    ,sum(decode(to_char(piDate,'mm'),'03',piValue)) as Mar
    ,sum(decode(to_char(piDate,'mm'),'04',piValue)) as Apr
    ,sum(decode(to_char(piDate,'mm'),'05',piValue)) as May
    ,sum(decode(to_char(piDate,'mm'),'06',piValue)) as Jun
    ,sum(decode(to_char(piDate,'mm'),'07',piValue)) as Jul
    ,sum(decode(to_char(piDate,'mm'),'08',piValue)) as Aug
    ,sum(decode(to_char(piDate,'mm'),'09',piValue)) as Sep
    ,sum(decode(to_char(piDate,'mm'),'10',piValue)) as Oct
    ,sum(decode(to_char(piDate,'mm'),'11',piValue)) as Nov
    ,sum(decode(to_char(pidate,'mm'),'12',piValue)) as Dec
    ,sum(piValue) as Total
    ,max(reportid) as ReportID
    ,max(waterdatatypeid) as WaterDataTypeID
    from LPInflow
    where reportid=14 and pidate >=to_date('2006/01/01','yyyy/mm/dd') and
    pidate <= to_date('2006/12/31','yyyy/mm/dd')
    group by to_char(piDate,'dd'),to_char(piDate,'yyyy');
    Also, the reportid is the same for all, but just using reportid instead of min/max reportid causes the query to fail..
    If I could get the correct query systax it would be great..
    Thanks .Very Much appreciated..

    Hi Swaroop,
                        I have a issue with allocation logic i.e is my scenario require allocation logic or i can write general logic,if yes,can you give a suggestion how to write..
    Scenario is..in my plan..
    I prepared a schedule for SALES planing...for which i have prepared a input scedule..
    My input schedule works like..COLs-SalesAccountits memberset isfiltered using propety i.e test3="C"
                                                     ROWs-ENTITY--its memberset is  filtered using propety i.e Plants="A"
                                                     Time--Taking from CV.
    When i take time 2009.INPUT from CV and enter the data for entity for respect salesaccounts and send the data.NEXT,
    I want to copy the same data to all the months of 2009...for that iam using allocation like
    *RUNALLOCATION
    *FACTOR
    //*USING
    *DIM ENTITY WHAT=Entity;                    WHERE=<<<:              USING=Entity.PLANTS
    *DIM SALESAccount WHAT=SALESACCOUNT;  WHERE=<<<:  USING<>SALESACCOUNT.TEST3
    *DIM TIME WHAT=BAS(%YEAR%.TOTAL); WHERE=<<<;          USING=%TIME_SET%;
    *ENDALLOCATION
    will it work my scenario does i need to add any other logic ...
    Suggest me sol..
    regards,
    Naresh.

  • My MacBook Pro keeps making copies of a document that I am trying to save. I don't want to duplicate the file. I only want to save it on both my hard drive and my external hard drive. I do not want to change its name for every save, which the computer see

    My MacBook Pro keeps making copies of a document that I am trying to save. I don't want to duplicate the file. I only want to save it on both my hard drive and my external hard drive. I do not want to change its name for every save, which the computer seems insistent on doing. Help!!

    11lizzyp wrote:
    can't be saved because the file is read-only.
    I did not create the file to be read-only. I created to be able to continue to add to it as I work on it.
    More on versions here:
    http://support.apple.com/kb/ht4753
    local snapshots:
    http://support.apple.com/kb/HT4878
    Sounds like a permissions problem ie read only.
    If running repair permissions from your DiskUtility.app does not sort it,
    Someone should jump in here with erudite and concise fix.

  • 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

  • I have had my ipod nano for 2 months, and the left earbud no longer works. Can I get a replacement, and how do I go about it?

    I have had my ipod nano 7th gen. for 2 months, and the left earbud no longer works. Can I get a replacement, and how do I go about it?

    Or make an appointment at the Genius Bar of an Apple store
      Apple Retail Store - Genius Bar

  • Ajax:callback function not called for every readystatechange of the request

    Author: khk Posts: 2 Registered: 2/17/06
    Feb 17, 2006 11:04 PM
    Hi
    I am working with an ajax program.
    In that i have defined a callback funtion
    but that function is not being called for every readystatechange of the request object for the first request .
    but it is working fine from the second request.
    function find(start,number){
    var nameField=document.getElementById("text1").value;
    var starting=start;
    var total=number;
    if(form1.criteria[0].checked) {
    http.open("GET", url + escape(nameField)+"&param2="+escape("exact")+"&param4="+escape(starting)+"&param5="+escape(number));
    else if(form1.criteria[2].checked) {
    http.open("GET", url + escape(nameField)+"&param2="+escape("prefix")+"&param4="+escape(starting)+"&param5="+escape(number));
    http.onreadystatechange = callback2;
    http.send(null);
    function callback2(){
    if (http.readyState == 4) {//request state
    if(http.status==200){
    var message=http.responseXML;
    alert(http.responseText);
    Parse2(message);
    }else{
    alert("response is not completed");
    }else{
    alert("request state is :-"+http.readyState);
    }

    Triple post.
    You have been answered here: http://forum.java.sun.com/thread.jspa?threadID=709676

  • Access 2010 Chart - Report returns an identical chart for every record in the underyling query

    Hi there, I hope someone can help me with this. I've created a stacked column chart in a Report. The chart seems to be working fine but my report is returning a chart for every record in the source query.  The chart adds up the days each vehicle in
    a fleet was used in a given time frame.  I'm not a code writer so wizarded my way to the following:
    TRANSFORM Sum(QVehicleDaysUsed.[DaysOfUseThisMonth]) AS SumOfDaysOfUseThisMonth SELECT QVehicleDaysUsed.[YearMakeModelPlate] FROM QVehicleDaysUsed GROUP BY QVehicleDaysUsed.[YearMakeModelPlate] PIVOT QVehicleDaysUsed.VehicleUseForMonthStarting;
    The chart seems to be producing exactly what I want but it's repeated once for every record in the source query. I don't know if this is the issue but I don't have a Master/Child field linking the chart to the report it's in - chart is unbound and therefore
    won't allow me to link fields. I'd sure appreciate any help you can offer! Thanks!
    (Incidentally VehicleUseForMonthStarting is a date field - ideally it should be shown as a DatePart MMMM but for whatever reason Access is balking at the Format expression.)
    Thanks!

    GOT IT! Hurray.  Obvious after giving it more thought... I had to make the report the chart was in Unbound. :) Leaving post up in case it helps someone else out.

  • Have not purchased music for 10 months, in the meantime card has expired, which has £1.74 in credit on it, tried to change card details to current last 4 numbers/expiry date and security code but keeps on rejecting and brings back old card details

    Have not purchased music for 10 months, in the meantime card has expired, which has £1.74 in credit on it, tried to change card details to current last 4 numbers/expiry date and security code but keeps on rejecting and brings back old card details

    Try here >  iTunes Store: My credit card's security code or zip code does not match my bank's records

  • Hi, I have an iphone 5 and unfortunately got sat on and is now bent, it worked fine bent for 3 months as the glass did not break, today how ever the screen has stopped working. Is it possible to get hold of another casing and have the electronics changed

    Hi, I have an iphone 5 and unfortunately got sat on and is now bent, it worked fine bent for 3 months as the glass did not break, today how ever the screen has stopped working. Is it possible to get hold of another casing and have the electronics changed ?

    You didn't look hard enough:
    Out-of-Warranty Service
    If you own an iPhone that is ineligible for warranty service but is eligible for Out-of-Warranty (OOW) Service, Apple will service your iPhone for the Out-of-Warranty Service fee listed below.
    iPhone model
    Out-of-Warranty Service
    iPhone 5s, iPhone 5c,
    iPhone 5
    $269
    iPhone 4S
    $199
    iPhone 4, iPhone 3GS,
    iPhone 3G, Original iPhone
    $149

Maybe you are looking for