How to get this date range

Respecetd guru,

I have the task of representing date at the end of each month of start of range.

it show like this...

01-sep-2009 to 30-Oct-2009
so now...
plez help me.

can you give example of this... so on can be something like this

SQL> select to_char(trunc(sysdate,'mm'),'dd-mon-yyyy')||' to '||to_char(last_day(sysdate),'dd-mon-yyyy') dt from dual;

DT
--------------------------
01-sep-2009 to 30-sep-2009

Please explain more clearly.

Tags: Database

Similar Questions

  • How to get the Date, month, year of the DateTimePicker

    Hi, I am using the DateTimePicker.

    There are several question about this command:

    1. how to get the Date, month and year?

    -With the help of myDateTime.value, I get this string ' Wed May 08 14:45 ICT 2013 '-> I have to manually analyze this? Because I need in format yyyy/mm/dd. Or can set the format of dateTimePicker.value?

    2 format on dateTimePicker self (on the user interface) is d/m/YY, I can't change to another format?

    Thank you

    dateTimePicker.value return a QDateTime not a string.

    https://developer.BlackBerry.com/Cascades/reference/bb__cascades__datetimepicker.html#property-value

    See more:

    https://developer.BlackBerry.com/Cascades/reference/QDateTime.html#date

    https://developer.BlackBerry.com/Cascades/reference/QDate.html

    You can get

    day = dateTimePicker.value.date().day()
    month = dateTimePicker.value.date().month()
    year= dateTimePicker.value.date().year()
    dateYYYYMMDD = dateTimePicker.value.date().toString(Qt::ISODate)
    dateYYYYMMDD2 = dateTimePicker.value.date().toString("YYYY/MM/DD")
    dateYYYYMMDD3 = dateTimePicker.value.toString("YYYY/MM/DD")
    
  • How to get the date for the first Monday of each month

    Dear members,

    How to get the date for the first Monday of each month.

    I wrote the following code

    SELECT decode (to_char (trunc (sysdate + 30, 'MM'), 'DAY'), 'MONDAY', trunc (sysdate + 30, 'MM'), NEXT_DAY (trunc (sysdate + 30, 'MM'), "LUN")) FROM DUAL

    But he looks at complex bith.

    Abhishek

    Published by: 9999999 on 8 March 2013 04:30

    Use the IW format - it will make independent NLS solution. And all you need is truncated 7th day of each month using IW:

    select  sysdate current_date,
            trunc(trunc(sysdate,'mm') + 6,'iw') first_monday_the_month
      from  dual
    /
    
    CURRENT_D FIRST_MON
    --------- ---------
    08-MAR-13 04-MAR-13
    
    SQL> 
    

    Here is the list of the first Monday of the month of this year:

    with t as(
              select  add_months(date '2013-1-1',level-1) dt
                from  dual
                connect by level <= 12
             )
    select  dt first_of_the_month,
            trunc(dt + 6,'iw') first_monday_the_month
      from  t
    /
    
    FIRST_OF_ FIRST_MON
    --------- ---------
    01-JAN-13 07-JAN-13
    01-FEB-13 04-FEB-13
    01-MAR-13 04-MAR-13
    01-APR-13 01-APR-13
    01-MAY-13 06-MAY-13
    01-JUN-13 03-JUN-13
    01-JUL-13 01-JUL-13
    01-AUG-13 05-AUG-13
    01-SEP-13 02-SEP-13
    01-OCT-13 07-OCT-13
    01-NOV-13 04-NOV-13
    
    FIRST_OF_ FIRST_MON
    --------- ---------
    01-DEC-13 02-DEC-13
    
    12 rows selected.
    
    SQL> 
    

    SY.

  • How to get the date of end of week max and its rows of a table

    Hello
    Table [temp2]
     
       id          name        dt
      123        a             2-mar-2010
      124        b            1-feb-2010
      125        c             3-apr-2010
      123        a             13-mar-2010
      125        c             13-mar-2010
      123        a             12-feb-2010
     
    This table how to get this line by id - name (id and the name of the composite key) whose date is the date of last weekend (last Saturday).
    for example, suppose to have IDs 123 values date February 12, 2010, 13-mar-2010 this date falls on the last Saturday 13-mar-2010, how to get the value of the line on Saturday last for all the unique id and the name?

    So I wrote this but probably there a few traps...
    select id,name,dt from (select id,name,dt,max(dt) over(partition by id,name) as 
    max_date from temp2) t where dt=t.max_date and dt in ('3-apr-2010'
    ,'27-mar-2010','20-mar-2010','13-mar-2010')
    Here I have spent in the in clause 4 last weekend dates manually (although either has been calculated by programming) in front.
    Thank you

    Here's another option:

    SELECT     *
    FROM
    (
         SELECT     ID
         ,     NAME
         ,     MAX(CASE WHEN TO_CHAR(DT,'DY','NLS_DATE_LANGUAGE=ENGLISH') = 'SAT' THEN DT END) AS DT
         FROM     TEMP2
         GROUP BY ID, NAME
    )
    WHERE DT IS NOT NULL
    

    It is always useful to provide the following information:

    1. oracle version (SELECT * FROM V$ VERSION)
    2. examples of data in the form to CREATE / INSERT commands.
    3. expected results
    4 explanation of the expected results (alias "business logic")
    5. use.

     tags for #2 and #3. See FAQ (Link on top right side) for details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    
  • Hi there is a balance of $20 showing on my Itunes account, however I don't seem to be able to use it to download a movie to rent.  Can someone tell me please how to get this balance...

    Hi there is a balance of $20 showing on my Itunes account, however I don't seem to be able to use it to download a movie to rent.

    Can someone tell me please how to get this balance...

    What happens when you try to rent the movie? If you use a family sharing and that you are the family Organizer so you won't be able to use your balance.

  • CODE - 641 Windows update has encountered an error of unkonwn. How to get this right

    CODE - 641 Windows update has encountered an error of unkonwn.  How to get this right

    Try to run the tool:

    http://support.Microsoft.com/mats/windows_update/

  • I lost some data during a copy and paste procedure between folders on a thumb drive... any ideas how to recover this data?

    I lost some data during a copy and paste procedure between folders on a thumb drive... any ideas how to recover this data?

    I lost some data during a copy and paste procedure between folders on a thumb drive... any ideas how to recover this data?

    If you did a copy and paste, the original files are left intact when they came.  If you did a cut and paste, they are lost if you do not paste them and your paperweight (the location of storage to copy or cut and paste) was allowed.  It would be cleared if you did quite exemplary or cuts too fill it, or if you rebooted.

  • I reinstalled adobe CS6. my other macs, I had a printer named 'Adobe PDF', that I could choose that as my printer and a dialogue box came up, I named the file and the location.  I can't figure out how to get this done on my new mac.  Help

    I reinstalled adobe CS6. my other macs, I had a printer named 'Adobe PDF', that I could choose that as my printer and a dialogue box came up, I named the file and the location.  I can't figure out how to get this done on my new mac.  Help

    There are two ways to create a PDF on a Mac:

    (1) you can use the default method, which is to choose file > print. Click on the PDF menu below on the left, then click on save as PDF. This lets you name and save the PDF file using the mechanism of OS X to create PDF files.

    (2) in the same menu, you can save in Adobe PDF format. It runs a script (a little slow) that lets choose you what PDF settings file you want to use. This is the Adobe-developed mechanism that replaces the old Virtual PDF printer.

  • Can someone show me how to get the data of this vi in four columns in a spreadsheet file.

    I'm trying to get the data into four columns on a worksheet. The data consists of two channels and two measures, a maximum voltage and a voltage after x seconds. I enclose the code. Any help would be great. Thank you.


  • during an update lots of my profile folder has been put in a folder on the desktop marked the old data. How to restore this data file

    During a bet to update, automatic update of windows has started and some how much my profile data has been removed and stored in a file on the desktop. There is a simple and easy way to restore this folder from the current firefox?

    You can use the contents of the Old Firefox Data folder to "roll back" the refresh, but this involves several steps. It's probably even faster than the recovery of individual files and load those into your new profile.

    Check in the folder 'Old data Firefox' update adds a folder with a random semi name on your desktop. If there is only one, that probably has your old settings and Add-ons. If there is more than one, you'll want to work with one who has been updated recently.

    Once you have identified the profile folder, that you want to restore, here is my "old profile resurrection suggested procedure:

    Overview

    Here are the steps described in more detail below:

    1. Create a new Firefox profile
    2. Delete all of this profile folder
    3. Copy in all of the old profile folder

    Create a new profile for Firefox (Windows)

    Exit Firefox completely and start up in the Profile Manager by pasting the following in the Windows search, or the Run dialog box by pressing ENTER:

    firefox.exe -P
    

    Note: any time want to switch profiles, exit Firefox and return to this dialog box.

    Click on the button create a profile, give it a name like OldSettings and skip the option to change the location of the folder. Select the new profile from the dialog box, and then start Firefox.

    Open the new profile folder in Windows Explorer

    Firefox in the new profile should look like a new installation of the plant. Open the troubleshooting information page by using either:

    • button "3-bar" menu > "?" button > troubleshooting information
    • Menu help > troubleshooting information
    • type or paste everything: in the address bar and press Enter

    In the first table, click on the view file"" button. Firefox will launch your new profile folder in Windows Explorer.

    This folder open, switch back to Firefox and get out by using either:

    • "3-bar" menu button > button "power".
    • (menu bar) File > Exit

    Firefox is closed, the profile folder must be front and Center, or you can activate it by using the taskbar.

    Copy old data instead of new

    In this new profile folder you just popped open - NOT the one on your desktop - select all content (you can use Ctrl + a) and delete (you can press Delete on the keyboard).

    Leave this window open, open or switch to your folder of old data of Firefox. Consult your old profile folder. At this level, you should see a folder named bookmarkbackups among other things.

    Select all (Ctrl + a) and copy (or right-click > copy or Ctrl + c).

    Switch to the empty profile folder in another window and paste (or right-click > paste or Ctrl + v). This may take a few minutes because some files are large.

    Launch Firefox

    Firefox should start in this 'new' profile with the old resurrected profile data. Success?

  • How to get a date to the timestamp of a file XML format

    Hello

    I'm trying to get a date from an external XML file. My XML file looks like this:


    <>http://www.NI.com/LVData">
        8.6.1
        
            Date of birth
            31/03/1983
        
     

    I can get the system to retrieve the correct XML element that shows the nested and elements , but I have no way to retrieve correctly the date. It seems as if she interprets my date seconds since 1904. I try to keep the "readable" for the end user XML, so it is important to keep this date in standard U.S. date format. I eventually uses this date to calculate the age of something. I labour code to subtract a timestamp in the format of the date to the current date and time, but I can't access it when I get back from XML.

    Starting from XML schema, it looks like the timestamp element requires a cluster... but there is no documentation on what to spend. Any ideas how to get back an XML date in this format in a simple and clean?

    Here's my current VI:

    Thank you

    Ryan

    Cambridge, MY

    Quick Tip on "bundle by name.  You don't need to consolidate all these constants where the values correspond to what is the constant of cluster at the top.  The cluster constant defines the data structure and the starting values.  Simply group the values for specific change items.

    Example of tone would be a bit cleaner.  Although the format string should use a capital T.

    As always with dealing with the time, complications could arise due to dealing with time zones and leap years.  Zones shouldn't matter for the calculation of the years since you are rounded up to years.  Although you probably want to round down rather than round at most closely. (I forgot this part in my example).  The problem with leap years when you would be only in a certain number of days of the anniversary, he would round up the age.  The number of rounded days would depend on how much on leap days that nobody has seen in their lifetime.

  • How to get this challenge of output using joint?

    We will create a document XML E2B to query an Oracle Argus Pharmacovigilance DB.  Problem is when trying to generate the tag < drugs >.

    -A drug (or product) can have multiple schemas.

    -A drug can have several indications.

    If a product has several treatment regimens and the indications must be created 1 < drugs > tag to each plan and each indication. However, let us assume that there is only 1 sign and 1 plan, we should produce 1 single tag. If we have 2 regimens and directions 1, we should be producing 2 labels. 1 label must include 1 plan and 1 sign and the other tag should have the indication of information etc...

    Like this:

    If a drug (product) 1 indication and 1 plan we should output like this:

    < drugs >

    < scheme > 1 < / plan >

    < indication > 1 < / indication >

    < / drugs >

    If the drug has 2 indications and 2 diagrams then we should output like this:

    < drugs >

    < scheme > 1 < / plan >

    < indication > 1 < / indication >

    < / drugs >

    < drugs >

    < system > 2 < / plan >

    < indication > 2 < / indication >

    < / drugs >

    If a drug has 2 directions and following the 1 pattern, we should output like this:

    < drugs >

    < scheme > 1 < / plan >

    < indication > 1 < / indication >

    < / drugs >

    < drugs >

    < indication > 2 < / indication >

    < / drugs >

    If a drug has 1 indication and 2 diagrams, then like this:

    < drugs >

    < scheme > 1 < / plan >

    < indication > 1 < / indication >

    < / drugs >

    < drugs >

    < system > 2 < / plan >

    < / drugs >

    and so on...


    I am trying to create a query to get the records to do this, but have problems.  I created 3 examples of tables with test data. It seems that this can be done by using joins. I do not know. Can someone tell me

    drop table Case_Prod_Indications_;

    drop table Case_Dose_Regimens_;

    drop table Case_Product_;

    Create Table Case_Product_

    (

    Number of Case_Id

    Number of Seq_Num,

    product_id VARCHAR2 (5).

    reported_Name Varchar2 (15).

    Constraint Case_Product_Pk Primary Key (Case_Id, Seq_Num)

    );

    Create Table Case_Dose_Regimens_

    (

    Number of Case_Id

    Number of Seq_Num,

    Number of Log_No

    Regimen_Description Varchar2 (20).

    Constraint Case_Dose_Regimens_Pk Primary Key (Case_Id, Seq_Num, Log_No),

    Constraint Regimens_2_Product_Fk Foreign Key (Case_Id, Seq_Num) made reference Case_Product_ (Case_Id, Seq_Num)

    );

    Create Table Case_Prod_Indications_

    (

    Number of Case_Id

    Number of Prod_Seq_Num

    Number of Seq_Num,

    Indication Varchar2 (25).

    Constraint Case_Prod_Ind_Pk Primary Key (Case_Id, Prod_Seq_Num, Seq_Num),

    Constraint Foreign Key (Case_Id, Prod_Seq_Num) to indics_2_Product_Fk references Case_Product_ (Case_Id, Seq_Num)

    );

    Case_Product_ p, Case_Dose_Regimens_ r's Case_Prod_Indications_ I

    We always want an output for a particular case_id ONLY.

    Scenario1: Product has only been inserted to case_product, with no product_id, but with a reported indication.

    INSERT INTO case_product_ VALUES (100, 1, NULL, 'Panadol');

    COMMIT;

    Output should be: 1 plug as shown below

    p.case_id p.seq_num p.product_id, p.reported_name, r.regimen_description, i.indication

    100                 1                         null                          Panadol                          null                                       null

    Request used:

    Select

    P.Case_Id, P.Seq_Num, P.Product_Id, P.Reported_Name, R.Regimen_Description, I.Indication

    Of

    Case_Product_ P

    Left outer join Case_Dose_Regimens_ R (P.Case_Id = R.Case_Id And P.Seq_Num = R.Seq_Num)

    Outer join Case_Prod_Indications_ left I on (P.Case_Id = I.Case_Id And P.seq_num = I.Prod_Seq_Num)

    WHERE

    p.case_id = 100;

    Output is OK? : YES.

    Scenario2: Product diagrams a.

    INSERT INTO case_product_ VALUES (200, 10, 3, "Disprin");

    INSERT INTO case_dose_regimens_ VALUES (3, 1, 10, 200 mg');

    INSERT INTO case_dose_regimens_ VALUES (200, 10, 2, 5 mg');

    COMMIT;

    Output should be: 2 records as shown below

    p.case_id p.seq_num p.product_id, p.reported_name, r.regimen_description, i.indication

    200                10                          3                          Disprin                          3mg                                         null

    200                10                          3                          Disprin                          5mg                                         null

    Request used: same as above, but with case_id = 200.

    Select

    P.Case_Id, P.Seq_Num, P.Product_Id, P.Reported_Name, R.Regimen_Description, I.Indication

    Of

    Case_Product_ P

    Left outer join Case_Dose_Regimens_ R (P.Case_Id = R.Case_Id And P.Seq_Num = R.Seq_Num)

    Outer join Case_Prod_Indications_ left I on (P.Case_Id = I.Case_Id And P.seq_num = I.Prod_Seq_Num)

    Where

    p.case_id = 200;

    Output is OK? : YES.


    Scenario3: Product has patterns AND directions. Here, there are more indications that treatment regimens.

    INSERT INTO case_product_ VALUES (300, 30, 5, "Aspirin");

    INSERT Into Case_Dose_Regimens_ Values (300, 30, 1, 65 MG');

    INSERT INTO case_prod_indications_ VALUES (300, 30, 1, 'Bread');

    INSERT INTO case_prod_indications_ VALUES (300, 30, 2, 'Vomiting');

    COMMIT;

    Output should be: 2 records as shown below

    p.case_id p.seq_num p.product_id, p.reported_name, r.regimen_description, i.indication

    300                30                               5                          Asprin                          65MG                                    Pain

    300                30                               5                          Asprin                          null                                         Vomiting

    Request used: same as above, but with case_id = 300.

    Select

    P.Case_Id, P.Seq_Num, P.Product_Id, P.Reported_Name, R.Regimen_Description, I.Indication

    Of

    Case_Product_ P

    Left outer join Case_Dose_Regimens_ R (P.Case_Id = R.Case_Id And P.Seq_Num = R.Seq_Num)

    Outer join Case_Prod_Indications_ left I on (P.Case_Id = I.Case_Id And P.seq_num = I.Prod_Seq_Num)

    Where

    p.case_id = 300;

    Output is OK? : No. we get 65MG for the 2nd record as well.

    Scenario4: Product has patterns AND directions. Here there are patterns and equal information.

    INSERT Into Case_Dose_Regimens_ Values (4, 2, 30, 300 kg');

    commit;

    Output should be: 2 records as shown below

    p.case_id p.seq_num p.product_id, p.reported_name, r.regimen_description, i.indication

    300                30                          5                          Asprin                               65MG                                    Pain

    300                30                          5                          Asprin                               4kg                                        Vomiting

    Request used: same as above.

    Output is OK? : no today, we get 4 rows.

    Scenario5: Product has patterns AND directions. Here, there are patterns more than indications.

    INSERT Into Case_Dose_Regimens_ Values (6, 3, 30, 300 g');

    commit;

    Output should be: 3 discs as shown below

    p.case_id p.seq_num p.product_id, p.reported_name, r.regimen_description, i.indication

    300                     30                               5                                    Asprin                          65MG                               Pain

    300                     30                               5                                    Asprin                          4kg                               Vomiting

    300                     30                               5                                    Asprin                          6g                                         null

    Request used: same as above.

    Output is OK? : No. now we get 6 entries.

    How we do this? Or can not use joins and perhaps another method?

    Any help would be greatly appreciated.

    Hello

    I see it; you need in a few lines of possible exit, until all rows in related tables are included.  You don't care which line of case_dose_regimens gets paired with what line of case_prod_indications, you want just the 1st row of each table (or the 1st line of a table, if there is no matching data in the other) together on the 1st row of output and the 2nd row of each table set on 2nd line , and so on and in what order is used to define the "1st" and "2nd" is not important.  Is this fair?

    If so, then use the ROW_NUMBER analytic functions to assign numbers (I called it r_num) to identify the 1st, 2nd,... lines, like this:

    WITH schema AS

    (

    SELECT case_id, seq_num, regimen_description

    , ROW_NUMBER () OVER (PARTITION BY case_id, seq_num)

    ORDER BY log_no - or what you want

    ) AS r_num

    OF case_dose_regimens_

    )

    directions,

    (

    SELECT case_id, prod_seq_num, indication

    , ROW_NUMBER () OVER (PARTITION BY case_id, prod_seq_num)

    ORDER BY seq_num - or what you want

    ) AS r_num

    OF case_prod_indications_

    )

    SELECT p.case_id, p.seq_num, p.product_id, p.reported_name

    r.regimen_description

    i.indication

    OF case_product_ p

    LEFT OUTER JOIN

    (diagram r

    FULL OUTER JOIN indication I have ON i.case_id = r.case_id

    AND i.prod_seq_num = r.seq_num

    AND i.r_num = r.r_num

    )

    ON p.case_id = COALESCE (r.case_id

    i.case_id

    )

    AND p.seq_num = COALESCE (r.seq_num

    i.prod_seq_num

    )

    WHERE p.case_id (300)

    ORDER BY p.case_id, p.seq_num

    , COALESCE (r.r_num, i.r_num)

    ;

  • How to get future data 3 months

    Hi all

    I have a requirement where I need to get future 3 months of data.

    example: this month is jan

    In the report, I need to get jan, Feb, March data months.

    Please let me know how to do this, thanks in advance.

    Thank you and best regards,

    SR

    Use the report filter using your column in months as below

    month > = month (CURRENT_DATE) and month<>

  • How to get the data to uppercase

    Hi all

    I have a table with 100 columns, all character only (varchar2) type. In the data that have already inserted with tiny...

    Can here, my question is how I get all the data to uppercase only...

    I'm trying as select upper (t.*) in tablename t; He is in error... no idea please help me...

    Thanks and greetings

    Stéphane

    or you can create queries like this without having to type all of the columns;

    Select 'select'. listagg ('upper('|| c.COLUMN_NAME||')) (',',') within the Group (order 1) |' from TABLENAME'

    of dba_tab_cols c

    where c.TABLE_NAME = 'TABLENAME '.

    ----

    Ramin Hashimzade

  • How to get the data center moref moref VM in c# using

    Hi all

    Could someone tell how to get managedobjectreference of data center using the VM moref? or any other easy way is? If anyone has examples of code in c# please share with me?

    Thank you

    Vijaya

    You can get the data center in which the virtual machine resides by the following search:

    VM Moref-> Parent (vmFolder)

    Moref folder VM-> Parent (data center)

    Parent of the virtual computer object will always be the vmFolder and the vmFolder object will always be a data center.

    For more details on the model of article inventory of vSphere, take a look at this blog post - http://www.doublecloud.org/2010/03/vsphere-inventory-structure-deep-dive/

Maybe you are looking for