Date of entry into monthly intervals

Hello

How could I do a count by month but from a certain date.

I want to count the number of decreases from. So count on Jan 14, then another month to Feb. 14, March 14 etc...

Jan - 14Feb - 14Mar - 14Apr - 14-14 mayJun - 14Jul - 14Aug - 14Sep - 14
5012030etc.

example:

SELECT COUNT (*), - the MONTH of

TABLE

Group by MONTH

Hello

Chloe_19 wrote:

Hello

How could I do a count by month but from a certain date.

I want to count the number of decreases from. So count on Jan 14, then another month to Feb. 14, March 14 etc...

Jan - 14 Feb - 14 Mar - 14 Apr - 14 -14 may Jun - 14 Jul - 14 Aug - 14 Sep - 14
50 120 30 etc.

example:

SELECT COUNT (*), - the MONTH of

TABLE

Group by MONTH

To map all the dates in a calendar month with a common value, use TRUNC (d, 'MONTH').

However, grouping which will produce a separate line for each month, not a separate column as you asked.  For the different columns for different months, use SELECT... PIVOT, like this:

WITH relevant_data AS

(

SELECT TRUNC (MONTHS_BETWEEN (hiredate, DATE ' 1981-01-01')) + 1 AS month_num

FROM scott.emp

)

SELECT *.

OF relevant_data

PIVOT (COUNT (*)

FOR month_num IN (1 AS jan_1981

2 UNDER feb_1981

--  ...

12 AS dec_1981

)

)

;

Fill in the other months should be easy.

Output:

JAN_1981 FEB_1981 DEC_1981

---------- ---------- ----------

0          2          2

For more info on swivel (including other ways besides SELECT... See the FAQ of the PIVOT forum): Re: 4. How can I convert rows to columns?

Tags: Database

Similar Questions

  • Need help get data with the most recent date of entry into

    Hey guys;

    I need help with fine tuning a query to get the one with the most recent implementation.

    Here's my current query:

    /**********************************************
    Select sge.seal_group_id,
    SGE.equipment_id,
    SGE.effective_date
    of seal_group_equipment EMS.
    seal_group sg
    where equipment_id = 48801
    AND EMS. SEAL_GROUP_ID = SG. SEAL_GROUP_ID
    and sge.end_date is null
    Group of sge.equipment_id, sge.seal_group_id, sge.effective_date
    After having sge.effective_date = max (sge.effective_date)

    ******************************************************/

    Which produces the following results:
    SEAL_GROUP_ID - EQUIPMENT_ID - EFFECTIVE_DATE
    25-48801 - 01/01/1993-00: 00:00
    11730-48801 - 22/08/2003 08:42:11


    What I really need, is to show only the line with the most recent date of entry into
    I hope someone can help
    Thank you

    MAX will not work because the SEAL_GROUP_ID could depart. I would say analytical:

    select seal_group_id,
    equipment_id,
    effective_date
    from (
    select sge.seal_group_id,
    sge.equipment_id,
    sge.effective_date,
    RANK() over (partition by equipment_id order by effective_date desc) r
    from seal_group_equipment sge,
    seal_group sg
    where equipment_id = 48801
    AND SGE.SEAL_GROUP_ID = SG.SEAL_GROUP_ID
    and sge.end_date is null)
    where r = 1;
    

    Keep in mind if two records have the same effective_date, they would both appear.

    Note: query above has not been tested, since there is no script provided.

  • Date of entry into procedure statement

    Hi all.


    a DVICE me please what is the error in this statement 'a' in this procedure. the procedure to obtain the name of the table and date from the user and execute it.
    I think that my error for the format of the date in a statement. So, please give me the correction if you can.



    CREATE OR REPLACE PROCEDURE sp (table_name in varchar2, date_begin to date DEFAULT null)
    is
    type bulk_collect is table of index varchar2 (1000) by PLS_INTEGER;
    v_bluk1 bulk_collect;
    v_bluk2 bulk_collect;
    a varchar2 (300);
    c varchar2 (30);

    Start
    c: = table_name;
    r: = ' select rowid, id of ' | c | ' where date_of_ins > = ' | to_date(date_begin,'''dd/mm/yyyy'''); 

    immediately run a bulk collect into v_bluk1, v_bluk2;
    b in v_bluk1.first... loop v_bluk1. Last
    dbms_output.put_line (v_bluk1 (b));
    end loop;

    end;
    /




    SQL > exec sp ('emp', to_date (' 1/2/2006 ',' dd/mm/yyyy'));
    START sp ('emp', to_date (' 1/2/2006 ',' dd/mm/yyyy')); END;

    *
    ERROR on line 1:
    ORA-00904: "FEB": invalid identifier
    ORA-06512: in the 'END. "SP", line 13
    ORA-06512: at line 1

    Published by: Isabelle Sep 8, 2012 11:23

    Change according to your need...

    bkd@Oracle>ed
    Wrote file afiedt.buf
    
      1  CREATE OR REPLACE PROCEDURE sp(table_name in varchar2,dt IN date)
      2  is
      3  type bulk_collect is table of varchar2(1000) index by PLS_INTEGER;
      4  v_bluk1 bulk_collect;
      5  v_bluk2 bulk_collect;
      6  a varchar2(1000);
      7  begin
      8  a:= 'select last_name from  '|| table_name ||' where hire_date <= :dt';
      9  dbms_output.put_line (a);
     10  execute immediate a bulk collect into v_bluk1  using dt;
     11  dbms_output.put_line (a);
     12  for b in 1..v_bluk1.count loop
     13  dbms_output.put_line (v_bluk1(b));
     14  end loop;
     15* end;
    bkd@Oracle>/
    
    Procedure created.
    
    bkd@Oracle>exec sp('employees',to_date('01/02/2012','dd/mm/yyyy'));
    select last_name from  employees where hire_date <= :dt
    select last_name from  employees where hire_date <= :dt
    OConnell
    Grant
    Whalen
    Hartstein
    Fay
    

    Concerning
    Biju

    Published by: biju2012 on Sep 9, 2012 12:47 AM

    Correction: Replace for b in v_bluk1.first... v_bluk1. Last loop b loop 1.v_bluk1.count

  • How to convert the Dates of entry into ReminderInfo in observed activity!

    Hello

    We read the Date and time of the reminder of the user via the form. We want to link this entry date and time with ReminderInfo data type to set

    Reminders in activity Task Assign.

    Please find the ppt for more information.

    Please help us in this regard.

    Thank you

    Praveen

    Drag a SetValue component and add assignments (see the screenshot to the assignment)

    Repeat the same thing for hours and minutes

    Nith

  • Date of entry into french

    I have a date I want to display in a text control.

    I have no problem to display it in the use of English
    < mx:DateFormatter id = 'dateFormatter' formatString = "EEEE D MMMM YYYY" / >
    and
    < mx:Text text = "{dateFormatter.format (mydate)}" / > "

    I got: Wednesday, July 11, 2007

    But how can I do the same in french: Wednesday, July 11, 2007

    Thanks for help

    Etienne

    There is a DateBase class that contains the messages localized to date in Flex, you can set the values of the DateBase trainer, like this: (this example is in Spanish)

    Import mx.formatters.DateBase;

    public function setDateBase (): void {}
    DateBase.monthNamesLong = ['Dom', "Lun", "Mar", "First", "Game", "Vier", "Sab"];
    DateBase.monthNamesShort = ["Ene", "Feb", "Mar", "Apr", "may", "Jun", "Jul", "There is", "Sep", "Oct", "Nov", "Dic"];
    }

    By doing this, you can set whatever string you want and objects Date, appear in your case, you just need define the days, the months in french and made.

    More information about the values that you can set:
    http://livedocs.Adobe.com/Flex/2/langref/MX/formatters/DateBase.html

  • Cannot turn off the field from the date of entry into application workflow

    Hello

    We implement the workflow application in OIM11g.

    We use application templates to achieve this.

    We want to disable or remove the field from the effective date in the rationale page that appears when we raise a request. Did one of you has implemented or came across this scenario. Please update if you have an idea about that.

    Thank you

    The property system will remove the entire page of the process, including the justification box.

    -Kevin

  • Date of entry into french? Possible?

    Hello

    I want to create a label that indicates the date:

    {" < mx:Label text =" {}df.format (new Date ())}" / > "

    " < mx:DateFormatter formatString ="EEEE DD MMMM YYYY - HH"id =""" df / >

    Then it works fine. But how to put french? Possible? : s

    Thank you very much!

    Chandler

    Took too long to respond...

    As I said in the previous message, use copylocale.exe in the folder "Applications/Adobe Flex Builder 3/sdks/3.2.0/bin/" command line to create the directories en_US missing.

  • DATE of entry into sql

    Hi all

    using the... 10 gr 2

    I have the following in a sql query
    LEAD(data_date, 1, DATE '9999-12-31')
                                                OVER (PARTITION BY route_id ORDER BY data_date)
                                                AS next_data_date
    I need replace the date format DD-MM-YYYY in the sql above... When I tried the to_date('12-31-9999','MM-DD-YYYY') it throws error


    Grateful for your help!

    Thanks in advance
    H

    It is a fixed format, and you should not have to change this part.
    "The date literal ANSI does not contain any portion of time and must be specified in exactly this format ("YYYY-MM-DD'). " You can also specify a date value Oracle... »
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/sql_elements003.htm#sthref365

  • Date of entry into title of report output

    Hi all, I know that in BEEP you can insert the current date in the title of the report when a report is sent via FTP. Example my_file_%y%m%d.txt. In our database environment is always a day behind... so we need %d is essentially %d - 1. Does anyone have a creative solution to get around this?

    Thank you!

    If you use the break-up, you can decide on the name of the file.
    You use the burst, in that query, you can create your template file name.

  • Date of entry into text field

    Hello

    I'm the problem by entering the date in submitted text (this is the data type is date)

    After that date to conclude this textfield cursor does not move to the next textfield.

    If I make the data type of this field as a number and then the cursor moves to the next field

    What is the problem

    Thank you

    ~ AC

    Enter the date according to the format of the field mask.
    for example. If the format mask 'DD-MON-RR' is then enter data in 4 December 08 '

  • Trying to get ending entry into force for the groups of lines

    Hello world

    I searched the forums, but I can't find a post that is a problem quite like that.

    I have some data that looks like this:
            ID_NUM     EFFECTIVE ALLOC_PERCENT   ACCT
    ---------- --------- -------------   ----
           101 01-JUL-11            21   A1
           101 01-JUL-11            72   A2
           101 01-JUL-11             7   A3
    
           101 01-JUL-12            20   B1
           101 01-JUL-12            80   B2
    
           101 01-JAN-13            20   A1
           101 01-JAN-13            20   A2
           101 01-JAN-13            50   A3
           101 01-JAN-13            10   B1
    
           101 01-JUN-13            50   A1
           101 01-JUN-13            50   A2
    (note: I inserted manually empty lines for clarity)

    Here's the logic: the lines represent an assignment of percentage on the account for the identification number specified for this entry into force. A new date to cancel the previous, and if any line in the conceptual group is replaced, so they are all.

    I'll try to find the date when the effective period of each group ended and which includes in the game so that I can calculate then the number of days in a given line has been effective; something like that;
      ID_NUM     EFFECTIVE END_DATE   ALLOC_PERCENT ACCT
    ---------- --------- ---------- ------------- ----
           101 01-JUL-11 01-JUL-12             21 A1
           101 01-JUL-11 01-JUL-12             72 A2
           101 01-JUL-11 01-JUL-12              7 A3
    
           101 01-JUL-12 01-JAN-13             20 B1
           101 01-JUL-12 01-JAN-13             80 B2
    
           101 01-JAN-13 01-JUN-13             20 A1
           101 01-JAN-13 01-JUN-13             20 A2
           101 01-JAN-13 01-JUN-13             50 A3
           101 01-JAN-13 01-JUN-13             10 B1
    
           101 01-JUN-13 <null>                50 A1
           101 01-JUN-13 <null>                50 A2
    The end_date of the group is the EFFECTIVE_DATE of the next group (ordered by ID_NUM, EFFECTIVE_DATE).

    End_date of two rows is zero because there is no group of lines with an effective date the later - in my process, I'll NVL which sysdate so that my calculations of days will be valid.

    I tried some analytical queries with LEAD, but I couldn't figure out how to get the next date of the efficient group. I could get the entry into force of the next row, but not the next group. I couldn't specify how many lead lines to look forward, because there is not a number of rows in each group.

    How to fill the end_date column?

    Here's the code to create the above.
    create table t
    (id_num number,
     effective_date date,
     alloc_percent number,
     acct_code varchar2(4)
     );
    
    insert into t (id_num,Effective_date,alloc_percent,acct_code) values(101,'01-jul-2011',21.0,'A1');
    insert into t (id_num,Effective_date,alloc_percent,acct_code) values(101,'01-jul-2011',72.0,'A2'); 
    insert into t (id_num,Effective_date,alloc_percent,acct_code) values(101,'01-jul-2011',7.0,'A3');
    insert into t (id_num,Effective_date,alloc_percent,acct_code) values(101,'01-jul-2012',20.0,'B1');
    insert into t (id_num,Effective_date,alloc_percent,acct_code) values(101,'01-jul-2012',80.0,'B2');
    insert into t (id_num,Effective_date,alloc_percent,acct_code) values(101,'01-jan-2013',20.0,'A1');
    insert into t (id_num,Effective_date,alloc_percent,acct_code) values(101,'01-jan-2013',20.0,'A2');
    insert into t (id_num,Effective_date,alloc_percent,acct_code) values(101,'01-jan-2013',50.0,'A3');
    insert into t (id_num,Effective_date,alloc_percent,acct_code) values(101,'01-jan-2013',10.0,'B1');
    insert into t (id_num,Effective_date,alloc_percent,acct_code) values(101,'01-jun-2013',50.0,'A1');
    insert into t (id_num,Effective_date,alloc_percent,acct_code) values(101,'01-jun-2013',50.0,'A2');
    
    commit;
    
    select * from t;
    Oracle version information:
    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    "CORE 11.2.0.3.0 Production."
    AMT for Solaris: 11.2.0.3.0 - Production Version
    NLSRTL Version 11.2.0.3.0 - Production


    Thank you very much

    Hello

    Here is one more way to do using lead work.

    WITH ds as (id_num, effective_Date, lead (effective_date) select on end_date (id_num order, effective_Date))

    t

    Id_num group, effective_date)

    Select t.*, ds.end_date

    DS, t

    where t.effective_Date = ds.effective_Date;

  • Text field display [formatted] data date - different entry form.

    It is probubly simple but thanks for any help.  My client wants to text fields as they find tedious date drop-downs for its shape.  As a result, I formatted the field to display the date as he asked mmm / d.  Regardless of how the user inserts the date, it is displayed as well as the customer wants.

    The problem I am facing is that when I call data for the calculations it send information in the format it was entered rather then displayed.

    For example, a user can enter

    1-1 and it would show [Jan / 1] in the field, but returns a string value (1-1) with this.getField.  User can enter 01 jan, jan 1, jan - 1, 1-01, 01-01, ect. and it would all read correctly in the text formatted field.

    I wrote a simple script to convert the month in days but it won't work unless the information is returned in the same way, it is displayed.  Y at - it an easier way to convert a date text field into a variable [day of the year] regardless of how the data has been entered. (without drop downs).

    Please and thanks for any help.

    To get a date that you can use, use the util.scand method: http://livedocs.adobe.com/acrobat_sdk/11/Acrobat11_HTMLHelp/JS_API_AcroJS.89.1260.html

    With no information of the year, it will give the current year. You'll be able to get the day and the month as and use however desired. Note that Acrobat/Reader will not let you enter an invalid date (for example, February 30) when the field is formatted as a date, if it's not a matter of concern.

  • How can I get a report containing data on the current month and the next month

    How can I get next month?
    I want a report that include data on the current month and next month.

    My solution is "Closing Date". "" Fiscal month "> = Valueof (NQ_SESSION. CURRENT_MONTH)
    S 'closing Date '. "" Fiscal month "< = MONTH (CURRENT_DATE + 30)

    But this show only the information between the current month and the date of the day + 30 days

    Does anyone have a better solution?

    You can meet the next email [email protected].

    Greetings!

    GON,

    Add the near field date in your report, add a filter and choose between. Place the cursor in the first box and select Add - SQL expression, paste into the first expression that I gave you. Repeat for the 2nd box and voila it will filter you need. If you are unsure, then use the superior / equal to the value for the first term and the lower than the 2nd.

    see you soon
    Alex

  • The use of pins of status (4 outputs) and data (8 entries) of the parallel port pins at the same time.

    Hi all

    I'm a newbee in labview. As part of my project work, I need to get 8 digital inputs and send 4 digital outputs.so I think to use the Parallel Port on the pc.i can make use of 8 datalines for entries. I found the site NOR is it possible to use status for output pins. But is it possible to use status for output pins pins and data for entries to the time.please help even me also mention of the measures to take, or keep in mind while implementing.also include any example vi that could be useful.

    Thanks in advance

    I would recommed you to NOT use the parallel port. Now a day you have hardly a PC with parallel port. also if you have some old PC then most likely last version of LabVIEW (e.g. 2010) will need a lot more memory RAM and processor.

    If you want a solution very very low cost then I would recommend using an arduino to that effect. You can then download LabVIEW Interface for Arduino and start working.

    If you continue to use the parallel port, then you could try (I haven't worked with parallel port and have not tested the following solutions)

    Download VIPM and then install the enclosed package. It will add the port e/s palette in your labview. and you can use it.

  • If anyone has the data to be transferred monthly?

    If anyone has the data to be transferred monthly?

    Cloud license allows 2 activations http://www.adobe.com/legal/licenses-terms.html

    -Install on a 2nd computer http://forums.adobe.com/thread/1452292?tstart=0

    -https://helpx.adobe.com/creative-cloud/help/sign-in-out-activate-apps.html

    -Windows or Mac has no importance... 2 on the same operating system or 1 on each

    -Two activations on one account CAN NOT be used at the same time (to be noted in the link above of the license)

    Remove the license on a computer http://forums.adobe.com/thread/1442423?tstart=0 clouds can help

    -read http://helpx.adobe.com/x-productkb/policy-pricing/error-maxium-acitvation-exceeded.html

    -or https://helpx.adobe.com/x-productkb/policy-pricing/activate-deactivate-products.html

Maybe you are looking for

  • Why is it so difficult to get Firefox to play web videos?

    I developed a very basic login for my website page. It contains a second film 45. It works on IE, Chrome and Safari but do not work on Firefox. Why? I spent many hours trying to try workarounds with no luck. I plan to put just a statement on my front

  • Synchronization of the sides and the game account without messing up my files

    I heard there are problems with iTunes game screwing popular music libraries by downloading different versions of songs while they had previously charged. I don't want that to happen to me, but I like the feature that allows me to sync my ratings and

  • Update hard disc on Satellite L20

    Hi all I would like to change the hard drive of my Satellite L20-260...I installed a hard MK4026GAX drive, I would like to replace it with a bigger... by taking a peek on the internet I found hard drives as MK8032GAX... Yes, 80 is the size (80 GB) bu

  • stack overflow after upgrade CVI9.0 for 2010

    Hello I had the demand for work using DLL dynamically loaded at run time. Applications and DLLS have been developed in CVI9.0. After I upgraded to CVI2010 and compile the application, I received errors from missing variables in a function DLL call. W

  • HP officejet 4500 g510n-z print but not scan

    HP officejet 4500 g510n-z prints ok but not scan A computer to Windows Vista 32 bit 7 4 Windows machines Windows XP 2 machines running on the wireless have not tried usb No IP conflict worked the last time that I used it (months) printer works fine (