Query for getting data for every quarter for financial year

Hi,
My problem is I need to get the data for every quarter for financial year and also I need data for every week for financial year.
For example for financial year 2012-13, Apr2012 to Jun2012 would be Q1, Jul2012 to Sep2012 would be Q2 and so on. Total 8quarters should come upto Apr2013.
In the same way  1st apr 2012 to 7th apr 2012 would be week1, 8th apr to 15th apr would be week2 and son on. How to write a query for this scenario in oracle. Can anybody help me on this. very urgent..
Thanks in advance.

lakmesri wrote:
Hi,
My problem is I need to get the data for every quarter for financial year and also I need data for every week for financial year.
For example for financial year 2012-13, Apr2012 to Jun2012 would be Q1, Jul2012 to Sep2012 would be Q2 and so on. Total 8quarters should come upto Apr2013.
In the same way  1st apr 2012 to 7th apr 2012 would be week1, 8th apr to 15th apr would be week2 and son on. How to write a query for this scenario in oracle. Can anybody help me on this. very urgent..
Thanks in advance.
How can you get 8 quarters within a year ? I'b be concerned here.
lakmesri wrote:
Hi,
In the same way  1st apr 2012 to 7th apr 2012 would be week1, 8th apr to 15th apr would be week2 and son on. How to write a query for this scenario in oracle. Can anybody help me on this. very urgent..
Thanks in advance.
First, that question is really not clearly asked. Second how could it be urgent ? You even did not tell us your Oracle version, did not show any tables descr, output sample nor any effort on your side to work on.
Nicolas.

Similar Messages

  • Want to create RFC FM for Getting data in CRM from R/3

    Hi,
    I have made the RFC connection in CRM system , now I want to make RFC FM for getting data from R/3 'MARD' table into CRM, If any one help me how to do this.
    From CRM system I will pass Plant & material no to FM and I need Storage location & Storage Bin from R/3 MARD table in CRM.
    Thanks
    Bobby

    Dear Bobby,
    You would create a FM in SE37 select 'Remote Enabled Module' radio-button in attributes tab of Function Builder.
    Select matnr werks LGORT LGPBE
               from MARD
               into ET_MARD
               where matnr = i_matnr
               and  werks = i_werks.
    Note:
    matnr is material number
    werks is plant
    LGORT is storage location
    LGPBE is storage bin
    Hope this will help.
    Regards,
    Naveen.

  • ALV FUNCTION MODLE FOR GETTING DATA IN EXCEL SHEET

    HI ,
    CAN I HAVE ALV FUNCTION MODLE FOR GETTING DATA IN EXCEL SHEET
    Regards,
    Aruna

    Standard ALV grid uses the FM <b>ALV_XXL_CALL</b> for exporting data into Excel. You can put a break-point in the FM and check it for urself.
    for ur info - the above FM takes the internal table name, internal table content and the field catalog as input.

  • Settings for costing data in order types for plant maintenance

    i want to know the purpose of settings for costing data in order types for plant maintenance. do we need to do it for sure i mean are those settings mandatory to analyze the costs on work order

    Yes you need to maintain those settings, as the plant maintenance orders are also considered as cost objects and in order for you to post any cost, you need to have a cost object.  Unless you maintain these settings, the cost you posted cannot be settled to a cost center.
    Assign points as a way to say thanks.
    Madhav Nanduri

  • Formatted Text Field for getting Date

    I need a text field to get Date. does anyone know where I can find such a thing?
    all it needs to do is allow the user to type a date in dd/MM/yy format.
    10x.

    in a jtable it has a problem - when I press tab to exit the field the date is not changed.
    i set the on focus lost behaviour to commit, but still not working.
    also, it allows me to enter 4823749823/02/02 - and it translates it to the right format - I'm interested in something more fixed - allows to enter only 2 digits for day, 2 digits for month,2 digits for year.
    the relevent code I'm using is:
    // a cellEditor that uses a formatted text field that holds a Date object
    public class JFormattedDateCellEditor extends DefaultCellEditor {
    public JFormattedDateCellEditor(final JFormattedTextField textField) {
    super(textField);
    textField.setFocusLostBehavior(JFormattedTextField.COMMIT);
    textField.setHorizontalAlignment(SwingConstants.RIGHT);
    textField.setFont(JUtility.theFont);
    textField.setBorder(null);
    textField.addFocusListener(new FocusAdapter() {
    public void focusLost(FocusEvent e) {
    if (textField.getValue() == null) {
    textField.requestFocus();
    delegate = new EditorDelegate() {
    public void setValue(Object value) {
    textField.setValue((java.util.Date)value);
    public Object getCellEditorValue() {
    return textField.getValue();
    //to set the cell editor:
    column = collectionsTable.getColumnModel().getColumn(CollectionFrame_collectionsModel.DATE_COLUMN);
    column.setCellEditor(
    new JFormattedDateCellEditor(
    new JFormattedTextField(
    new DateFormatter(
    new SimpleDateFormat("dd/MM/yy")))));

  • Need advice for getting data service while traveling abroad

    I will be traveling in Norway and England and want to be able to use GPS on my Galaxy S4.  I can get along without voice service, and can rely on wi-fi for email and internet access.  I will be traveling for about 3 weeks.  Any suggestions?

    All the advise you need is right here Spokaneman! We want you to enjoy your trip to Norway and England. Yes, you can use your phone for data while traveling. Here is a link to our Global trip planner to get all the information about cost and what is needed to use your phone http://vz.to/1aGvDAs . You can add our bundle plan for 100mb for $25.00 per month or voice/data bundle for 100minutes/100sent messages and 100mb for $40.00 per month . You can also pay as you go with is $0.02 cent per KB and $20.48 per mb. Voice calls and text are extra if you're interested in those features.
    KinquanaH_VZW
    Follow us on Twitter @VZWSupport
    If my response answered your question please click the "Correct Answer" button under my response. This ensures others can benefit from our conversation. Thanks in advance for your help with this!!

  • EJB-Archive for getting Data from the DB

    Hello,
    I want to get data from the Database. I created a EJB-Project with an Entity Bean and a Session Bean.
    The jar-Archive that I generated is corrupt. Is that normal?
    Can you provide me with information on database acces?
    In ABAP it would be a piece of cake: Select * from table into ...;-)
    Greetings, Frank

    Hi Frank,
    I see that you are interested in getting data from R/3, please correct me if I'm wrong.
    If that's so, you cannot do it by purely using EJBs, as an entity bean maps to a Table row in the database, which is not quite straight forward in terms of R/3.
    The only way to get data from R/3 is to use
    1)Java + SAP JCO
    2)or a Netweaver technology like Webdynpro + Adaptive RFC
    3)Portal Component + SAP JCO.
    Again, assuming you're dealing with a WebAS server, coming to EJBs, its no different to any other application server. So, you need an RDBMS to use Entity Beans.
    Please let me know if you've got more doubts.
    Regards,
    Rajit

  • Get Last date of every Month in a year

    Hi All,
    I need to find last date of month for given year.
    Example:
    I used to pass date or year such as 2012 or 01-01-2012(DD-MM-YYYY)
    SQL query needs to return last date of every month such as
    31-01-2012
    28-02-2012
    31-03-2012
    30-04-2012
    31-12-2012
    for above requirement i have written the following SQL
    select rownum as row_count,
    case when rownum=1 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as Jan_month,
    case when rownum=2 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as Feb_month,
    case when rownum=3 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as mar_month,
    case when rownum=4 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as apr_month,
    case when rownum=5 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as may_month,
    case when rownum=6 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as jun_month,
    case when rownum=7 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as jul_month,
    case when rownum=8 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as aug_month,
    case when rownum=9 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as sep_month,
    case when rownum=10 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as oct_month,
    case when rownum=11 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as nov_month,
    case when rownum=12 then last_day(to_date(add_months(trunc(to_date('01-01-2012','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as dec_month
    from dual connect by level <= 12 order by rownum;
    Result
    Jan_Month
    Feb_Month
    Mar_Month
    Apr_Month
    may_month
    jun_month
    jul_month
    aug_month
    sep_month
    oct_month
    nov_month
    dec_month
    1
    31-01-2014
    2
    28-02-2014
    3
    31-03-2014
    4
    30-04-2014
    5
    31-05-2014
    6
    30-06-2014
    7
    31-07-2014
    8
    31-08-2014
    9
    30-09-2014
    10
    31-10-2014
    11
    30-11-2014
    12
    31-12-2012
    Excepted Result:
    am excepted result as single row such as
    Jan_Month
    Feb_Month
    Mar_Month
    Apr_Month
    may_month
    jun_month
    jul_month
    aug_month
    sep_month
    oct_month
    nov_month
    dec_month
    31-01-2012
    28-02-2012
    31-03-2012
    30-04-2012
    31-05-2012
    30-06-2012
    31-07-2012
    31-08-2012
    30-09-2012
    31-10-2012
    30-11-2012
    31-12-2012
    Kindly give me suggestion to archive above result.
    Thanks&Regards
    Sami

    I agree with Marcus Pivot is the way to go about this... But on the other hand you almost solved it yourself.. just a max function was needed for your expected output:
    select
    max(case  when rownum=1 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as Jan_month,
    max(case  when rownum=2 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as Feb_month,
    max(case  when rownum=3 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as mar_month,
    max(case  when rownum=4 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as apr_month,
    max(case  when rownum=5 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as may_month,
    max(case  when rownum=6 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as jun_month,
    max(case  when rownum=7 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as jul_month,
    max(case  when rownum=8 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as aug_month,
    max(case  when rownum=9 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as sep_month,
    max(case  when rownum=10 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as oct_month,
    max(case  when rownum=11 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as nov_month,
    max(case  when rownum=12 then last_day(to_date(add_months(trunc(to_date('01-01-2012','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as dec_month
    from dual connect by level <= 12 order by rownum;
    AND to avoid hardcoding you can also modify your query as :
    select
    max(case  when rownum=1 then last_day(to_date(to_char(rownum),'MM')) end) as Jan_month,
    max(case  when rownum=2 then last_day(to_date(to_char(rownum),'MM')) end) as Feb_month,
    max(case  when rownum=3 then last_day(to_date(to_char(rownum),'MM')) end) as mar_month,
    max(case  when rownum=4 then last_day(to_date(to_char(rownum),'MM')) end) as apr_month,
    max(case  when rownum=5 then last_day(to_date(to_char(rownum),'MM')) end) as may_month,
    max(case  when rownum=6 then last_day(to_date(to_char(rownum),'MM')) end) as jun_month,
    max(case  when rownum=7 then last_day(to_date(to_char(rownum),'MM')) end) as jul_month,
    max(case  when rownum=8 then last_day(to_date(to_char(rownum),'MM')) end) as aug_month,
    max(case  when rownum=9 then last_day(to_date(to_char(rownum),'MM')) end) as sep_month,
    max(case  when rownum=10 then last_day(to_date(to_char(rownum),'MM')) end) as oct_month,
    max(case  when rownum=11 then last_day(to_date(to_char(rownum),'MM')) end) as nov_month,
    max(case  when rownum=12 then last_day(to_date(to_char(rownum),'MM')) end) as dec_month
    from dual connect by level <= 12 order by rownum;
    Easy way: (without connect)
    SELECT LAST_DAY (TO_DATE (ROWNUM, 'MM')) AS Jan_month,
           LAST_DAY (TO_DATE (ROWNUM + 1, 'MM')) AS Feb_month,
           LAST_DAY (TO_DATE (ROWNUM + 2, 'MM')) AS Mar_month,
           LAST_DAY (TO_DATE (ROWNUM + 3, 'MM')) AS Apr_month,
           LAST_DAY (TO_DATE (ROWNUM + 4, 'MM')) AS May_month,
           LAST_DAY (TO_DATE (ROWNUM + 5, 'MM')) AS Jun_month,
           LAST_DAY (TO_DATE (ROWNUM + 6, 'MM')) AS Jul_month,
           LAST_DAY (TO_DATE (ROWNUM + 7, 'MM')) AS Aug_month,
           LAST_DAY (TO_DATE (ROWNUM + 8, 'MM')) AS Sep_month,
           LAST_DAY (TO_DATE (ROWNUM + 9, 'MM')) AS Oct_month,
           LAST_DAY (TO_DATE (ROWNUM + 10, 'MM')) AS Nov_month,
           LAST_DAY (TO_DATE (ROWNUM + 11, 'MM')) AS Dec_month
      FROM DUAL
    Cheers,
    Manik.

  • Single query to get data from different databases

    i need to capture certain fields from certain tables in database 1 and certain fields from certain tables in database 2 into one file using a single SQL statement.
    i tried searching on the net
    i found that dblinks can help
    but iam not sure if ill be able to create dblinks in my situation which is:
    i need to get data from oracle to be copied to mysql
    this is not a replication acitivity, but i need certain fields from one database and certain from the other
    so what iwas thinking is, if i use an sql query to get all the fields (i need around 40) from the different oracle databases and create a singlefile with one insert per select, i can then read that file into mysql
    instead of creating multiple sql queries for each table and creating separate files and eventually separate tables in mysql.
    can anyone help me here?
    or maybe suggest another approach.
    thanks

    Hi,
    I think dblink is the only option available to get data from different databases. It will work for your case too.
    CREATE DATABASE LINK db_link CONNECT TO user_name IDENTIFIED BY  password USING 'instance_name'you must have the system privilege 'create database link' to create db links. This way you can get the required data and put it in a table in oracle. But i dont know how to put this data from oracle table to Mysql.
    HTH
    Muneer

  • Launch a procedure every quarter of the Year

    Hello:
    I need to launch a procedure every first day of a quarter of the year (JAN-01, APR-01, JUL-01 and OCT-01) I know that there is a package, DBMS_JOB, but I have no idea how can I used it, plese some one of yours have an example. Thanks
    Angel

    USER_EXPORT Procedures
    There are two overloaded procedures. The first produces the text of a call to re-create the given job. The second alters instance affinity (8i and after) and preserves the compatibility.
    Syntax
    DBMS_JOB.USER_EXPORT (
    job IN BINARY_INTEGER,
    mycall IN OUT VARCHAR2);
    DBMS_JOB.USER_EXPORT (
    job IN BINARY_INTEGER,
    mycall IN OUT VARCHAR2,
    myinst IN OUT VARCHAR2);
    Parameters
    Table 48-10 USER_EXPORT Procedure Parameter
    Parameter Description
    job Number of the job being run.
    mycall Text of a call to re-create the given job.
    myinst Text of a call to alter instance affinity.
    WHAT Procedure
    This procedure changes what an existing job does, and replaces its environment.
    Syntax
    DBMS_JOB.WHAT (
    job IN BINARY_INTEGER,
    what IN VARCHAR2);
    Parameters
    Table 48-11 WHAT Procedure Parameters
    Parameter Description
    job Number of the job being run.
    what PL/SQL procedure to run.
    Usage Notes
    You must issue a COMMIT statement immediately after the statement.
    Some legal values of what (assuming the routines exist) are:
    'myproc(''10-JAN-82'', next_date, broken);'
    'scott.emppackage.give_raise(''JENKINS'', 30000.00);'
    'dbms_job.remove(job);'
    Note:1. have start date hardcoaded 1st of next quarter and next date have it as ADD_MONTHS(trunc(sysdate,'q'),3) which is 1st day of every querter

  • Query to get data for current week+13

    Hi Friends,
    I have two tables
    BACKLOG_WEEK_AFTER_ATP (LE)
    BACKLOG_ATP_GT_CW (RE)
    ** First I have to query whats the current week and year and it should come in this format ---- 2011-WK30
    columns in table BACKLOG_WEEK_AFTER_ATP are:
    ITEM_NUMBER      QUANTITY
    1N5418                 20
    1N5614                 30
    1N5806SM               10
    1N5811                  0
    2PFF6                  60columns in table BACKLOG_ATP_GT_CW are:
    ITEM_NUMBER     QUANTITY        YEAR_WEEK
    1N5418                30        2011-WK30
    1N5418                 5        2011-WK31
    1N5614                30        2011-WK32
    1N5806SM              30        2011-WK33
    1N5811                20        2011-WK32
    3EX473K1              20        2011-WK30My report should look like
    ITEM_NUMBER    2011-WK30  2011-WK31  2011-WK32  2011-WK33  ...............till 13th week
    1N5418                10         -5         -5         -5  ...............till 13t week
    1N5614                30         30          0          0  ................till 13th week
    1N5806SM              10         10         10         20  ................till 13th week
    1N5811                 0          0         20         20  ................till 13th week
    2PFF6                 60         60         60         60  ................till 13th week
    3EX473K1              20         20         20         20  ................till 13th weekTo get this report i have these conditions to keep in mind.
    1) If item_number not present in LE table and present in RE table then repeat what it is in RE table till 13th week
    2) If item_number not present in RE table and present in LE table then repeat what it is in LE table till 13th week
    3) If item_number present in LE and also present in RE table then do subtraction for RE - LE for that particular item_number till 13th week.
    4) If item_number is there in LE table but not present in RE table for current_week+1(today week comes as 29th week) then repeat the same which is there in LE table. If item is found in RE table for (example 32th week) then subtract RE -LE for that particular item_number
    Thanks in advance.
    Regards

    Hello,
    If you don't need the PIVOT display, then this may help you :
    with le as
    (select '1N5418' item_number, 20 quantity from dual union all
    select '1N5614' item_number, 30 quantity from dual union all
    select '1N5806SM' item_number, 10 quantity from dual union all
    select '1N5811' item_number, 0 quantity from dual union all
    select '2PFF6' item_number, 60 quantity from dual ),
    re as
    (select '1N5418' item_number, 30 quantity, '2011-WK30' year_week from dual union all
    select '1N5418' item_number, 5 quantity, '2011-WK31' year_week from dual union all
    select '1N5614' item_number, 30 quantity, '2011-WK32' year_week from dual union all
    select '1N5806SM' item_number, 30 quantity, '2011-WK33' year_week from dual union all
    select '1N5811' item_number, 20 quantity, '2011-WK32' year_week from dual union all
    select '3EX473K1' item_number, 20 quantity, '2011-WK30' year_week from dual
    row_gen as (
    select item_number, calc_year_week,
           row_number() over(partition by item_number order by calc_year_week) rn
    from
        (select le.item_number from le union select item_number from re) item,
        (select to_char(level*7+sysdate,'YYYY-"WK"WW') calc_year_week from dual connect by level<=13) week)
    select item_number, calc_year_week, calc_qty
    from row_gen, le, re
    where row_gen.item_number=le.item_number(+)
    and row_gen.item_number=re.item_number(+)
    and row_gen.calc_year_week=re.year_week(+)
    model
    partition by (row_gen.item_number)
    dimension by (rn)
    measures (calc_year_week, year_week, le.quantity le_qty,re.quantity re_qty,0 calc_qty )
    rules  (
    calc_qty[1]  =
        case when re_qty[cv()] is null then le_qty[cv()]
        when le_qty[cv()] is null then re_qty[cv()]
        else  re_qty[cv()]-le_qty[cv()]
    end,     
    calc_qty[rn>1] order by rn =
        case when re_qty[cv()] is null then calc_qty[cv()-1]
        else re_qty[cv()] - calc_qty[cv()-1]
        end           )
    order by 1,2;I am not sure this is the simplest way to do it, but the results seem to match your example.
    Regards,
    Sylvie
    Edited by: Troll35 on Jul 19, 2011 3:08 PM

  • Sql Query for getting data between two dates

    Dear Sir,
    I have one problem, i have date stored in varchar datatype of (X) table in mysql as it was not supporting the date format of (dd/mm/yyyy) so know the problem is,
    When i going to get the data between the the two dates it is giving the un reliable answers such that
    when i am asking the query as data between 1st April to 31st December 2009 it is showing the data from the 2008 .
    is there any way to solve this problem,please help this is an urgent requirement, your replay will be helpful to me.
    With Regards
    Ramakrishna Y

    You either have a SQL problem and this is the incorrect place to ask.
    Or you have a Java problem in code we cannot see. When posting code use the code tags. Click the CODE button and paste your code between the tags that appear.

  • How to get min date of every month for six months?

    Hi, i have data like this.
    Process_date SEQ_No
    16-MAR-13     733
    09-MAR-13     732
    02-MAR-13     731
    24-FEB-13     730
    16-FEB-13     728
    09-FEB-13     727
    02-FEB-13     726
    26-JAN-13     725
    21-JAN-13     724
    12-JAN-13     723
    05-JAN-13     722
    29-DEC-12     721
    24-DEC-12     720
    15-DEC-12     719
    08-DEC-12     718
    03-DEC-12     717
    22-NOV-12     716
    17-NOV-12     715
    10-NOV-12     714
    03-NOV-12     713
    29-OCT-12     712
    23-OCT-12     711
    13-OCT-12     710
    05-OCT-12     709
    28-SEP-12     708
    22-SEP-12     707
    15-SEP-12     706
    08-SEP-12     705
    01-SEP-12     704
    everymonth admin will refresh actual data table and automatically this above table will update with unique seq_no and process_date.
    I need to extarct min date of everymonth(First refresh of last 6 months - excluding currrent month) and also seq_no related to that month so using joins(using seq_no - that is available in main table) i can combine actual data.
    I need result like:
    02-MAR-13     731 ( I don't need MAR as it should not take current month data)
    so i need final result like below:
    02-FEB-13     726
    05-JAN-13     722
    08-DEC-12     718
    03-NOV-12     713
    05-OCT-12     709
    01-SEP-12     704

    995263 wrote:
    Hi, i have data like this.
    Process_date SEQ_No
    16-MAR-13     733
    09-MAR-13     732
    02-MAR-13     731
    24-FEB-13     730
    16-FEB-13     728
    09-FEB-13     727
    02-FEB-13     726
    26-JAN-13     725
    21-JAN-13     724
    12-JAN-13     723
    05-JAN-13     722
    29-DEC-12     721
    24-DEC-12     720
    15-DEC-12     719
    08-DEC-12     718
    03-DEC-12     717
    22-NOV-12     716
    17-NOV-12     715
    10-NOV-12     714
    03-NOV-12     713
    29-OCT-12     712
    23-OCT-12     711
    13-OCT-12     710
    05-OCT-12     709
    28-SEP-12     708
    22-SEP-12     707
    15-SEP-12     706
    08-SEP-12     705
    01-SEP-12     704
    everymonth admin will refresh actual data table and automatically this above table will update with unique seq_no and process_date.
    I need to extarct min date of everymonth(First refresh of last 6 months - excluding currrent month) and also seq_no related to that month so using joins(using seq_no - that is available in main table) i can combine actual data.
    I need result like:
    02-MAR-13     731 ( I don't need MAR as it should not take current month data)
    so i need final result like below:
    02-FEB-13     726
    05-JAN-13     722
    *08-DEC-12     718 (why??? if we have 03-DEC-12     717)*
    03-NOV-12     713
    05-OCT-12     709
    01-SEP-12     704i think you want something like this:
    WITH T(d,s) AS
    select to_date('16-MAR-13','dd-MON-yy'),733 from dual union all
    select to_date('09-MAR-13','dd-MON-yy'),732 from dual union all
    select to_date('02-MAR-13','dd-MON-yy'),731 from dual union all
    select to_date('24-FEB-13','dd-MON-yy'),730 from dual union all
    select to_date('16-FEB-13','dd-MON-yy'),728 from dual union all
    select to_date('09-FEB-13','dd-MON-yy'),727 from dual union all
    select to_date('02-FEB-13','dd-MON-yy'),726 from dual union all
    select to_date('26-JAN-13','dd-MON-yy'),725 from dual union all
    select to_date('21-JAN-13','dd-MON-yy'),724 from dual union all
    select to_date('12-JAN-13','dd-MON-yy'),723 from dual union all
    select to_date('05-JAN-13','dd-MON-yy'),722 from dual union all
    select to_date('29-DEC-12','dd-MON-yy'),721 from dual union all
    select to_date('24-DEC-12','dd-MON-yy'),720 from dual union all
    select to_date('15-DEC-12','dd-MON-yy'),719 from dual union all
    select to_date('08-DEC-12','dd-MON-yy'),718 from dual union all
    select to_date('03-DEC-12','dd-MON-yy'),717 from dual union all
    select to_date('22-NOV-12','dd-MON-yy'),716 from dual union all
    select to_date('17-NOV-12','dd-MON-yy'),715 from dual union all
    select to_date('10-NOV-12','dd-MON-yy'),714 from dual union all
    select to_date('03-NOV-12','dd-MON-yy'),713 from dual union all
    select to_date('29-OCT-12','dd-MON-yy'),712 from dual union all
    select to_date('23-OCT-12','dd-MON-yy'),711 from dual union all
    select to_date('13-OCT-12','dd-MON-yy'),710 from dual union all
    select to_date('05-OCT-12','dd-MON-yy'),709 from dual union all
    select to_date('28-SEP-12','dd-MON-yy'),708 from dual union all
    select to_date('22-SEP-12','dd-MON-yy'),707 from dual union all
    select to_date('15-SEP-12','dd-MON-yy'),706 from dual union all
    select to_date('08-SEP-12','dd-MON-yy'),705 from dual union all
    select to_date('01-SEP-12','dd-MON-yy'),704 from dual
    SELECT MIN(D),
           MIN(S) KEEP(DENSE_RANK FIRST ORDER BY D)
      FROM (SELECT D,
                   S,
                   TO_CHAR(D, 'mm') M,
                   TO_CHAR(D, 'yy') Y,
                   DENSE_RANK() OVER(ORDER BY TO_CHAR(D, 'yy') || TO_CHAR(D, 'mm') DESC) RN
              FROM T)
    WHERE RN BETWEEN 2 AND 7
    GROUP BY M, Y
    ORDER BY 1 DESC

  • SQL query to get the without SCCM agent for a Server

    Hello every one,
    Can I get the SQL query for a server without a SCCM agent . 

    Here you go!!
    Add the version for windows 2012 server if you have them as well in your environment
       v_R_System.Netbios_Name0
      ,v_R_System.Full_Domain_Name0
      ,v_R_System.User_Name0
      ,case
    When v_R_System.Operating_System_Name_and0 LIKE N'%Server 6.1'THEN 'Windows Server 2008 R2'
    When v_R_System.Operating_System_Name_and0 LIKE N'%Server 6.0'THEN 'Windows Server 2008'
    When v_R_System.Operating_System_Name_and0 LIKE N'%Server 5.2'THEN 'Windows Server 2003 R2'
     ELSE 'Unknown Version' END AS 'OS version'
    FROM
      v_R_System
    WHERE
      v_R_System.Operating_System_Name_and0 LIKE N'%server%' and v_R_System.Client0 is null
    Kindly mark as answer/Vote as helpful if a reply from anybody helped you in this forum. Delphin

  • Getting Data from SAP BW for Dashboard

    Hello,
    we want to create dashboards that are accessing data from a SAP BW 7.0 system without an EhP.
    I know that with BW 7.0 EhP1 we would be able to access queries directly. But for now we have the BOE 4 server and want to access the data over this software. Which possiblities exist to get the data from BW over the BOE 4 server?
    Thanks in advance,
    André

    Without the minimum requirements, you will not be able to use the BICS web service to retrieve data from BW directly.  In this case, you are limited to creating a Universe from the BEx query and then creating a Live Office or QaaWS connection from that Universe which you can then import to Xcelsius.  Unfortunately there are many layers to this along with some limitations due to processing the query via the MDX engine instead of OLAP.
    BEx>Universe>Live Office/QaaWS>Xcelsius

Maybe you are looking for

  • Installing Windows 8.1 64 bit on HP Stream 8.

    Hello,  HP stream 8 ships with win8.1 32 bit. I've a copy of win 8.1 64 bit which i intend to install on stream 8. Not sure if Boot from USB will work on this tab. Has anyone tried it? Any clue on performance as on stream 8 tab with 64 bit os? All ex

  • New iPod touch 4 won't work or restore after update

    I got an iPod touch 4 in January. (I am using an H-P desktop, 3.0Ghz, 2.5 GB RAM, 250 GB HD, mostly empty, with Win XP home.) The first time there was an iOS software update available, it didn't work after the update and would not restore. After many

  • HT204291 i cannot see the video but i can heard

    i heard the show but i cannot see the image

  • Best method for archiving .mpp files on a separate server or location?

    We want to be able to run a program or job on Project Server 2013 that will export all current published project .mpp files to a separate server or location on our network. What is the best, or suggested, method for something like this? Our managers

  • Error in output processing analysis

    Hi, we have maintained ZA output types corresponding to partner number as Personnel number and we have not maintained the address for the Pernr as thats how our business works. now the issue is when we process the output type ZA , we get an error in