Query of query for two dates

I am trying to query the database for a given date and the
next nearest older date within 28 days. This is what I have tried
but it isn't assigning anything to DD1 and DD2. i have tried a
number od other things but i am stumped.
<cfquery name="getdatedata" datasource="dairy">
SELECT MAX(std.DataDate) as DD1,
MIN(std.DataDate) as DD2,
DateDiff(d, MIN(std.DataDate), MAX(std.DataDate)) AS DDiff
FROM
(select top 2 datadate
FROM dairy.dbo.paddockdata
WHERE FarmId='#form.farmid#'
AND datadate between #datevalue#
and dateAdd("d", -28, #datevalue#)
ORDER by datadate DESC) AS std
</cfquery>

AND
( datadate between dateAdd("d", -28, #datevalue#) <!---
smallest value first. --->
and #datevalue#
)

Similar Messages

  • Hibernet query returns null for XMLTYPE data when I use oracle type4 driver

    Hi,
    I am using Oracle type-4 driver, My hibernet query returns null for data type XMLTYPE. But when I use BEA type -4 driver its working fine. Please help me to retrive XMLTYPE data using oracle-4 driver through hibernet query.
    Thanks in advance.
    regards,
    Amaresh

    Hi,
    I am using Oracle type-4 driver, My hibernet query returns null for data type XMLTYPE. But when I use BEA type -4 driver its working fine. Please help me to retrive XMLTYPE data using oracle-4 driver through hibernet query.
    Thanks in advance.
    regards,
    Amaresh

  • Sql query - been trying for two days

    Hi guys im trying to carry out an sql query
    Im using a left join to do a query, which gives me a set of results:
    select COURSESTUDENT.StudentNo, COURSESTUDENT.CourseCode, COURSESTUDENT.Year, MARKS.ExamMark, MARKS.EntryNo FROM COURSESTUDENT LEFT JOIN MARKS ON COURSESTUDENT.StudentNo=MARKS.StudentNo AND COURSESTUDENT.CourseCode=MARKS.CourseCode AND COURSESTUDENT.Year=MARKS.Year
    but I would like to do a select on this result but do not want to use a create view as if more than one person access this page at a time then if the servlet tries to create the view an error will occur.
    I would like to do the following select statement on the results of the query above..
    select * from (above) where CourseCode='ELE304' AND Year=1999;
    Is this possible, im using postgres..
    Please help......
    thanks
    tzaf

    just add "where ..." to the end of the first query.

  • Master data time dependant attribute in query for several dates

    Hello all,
    I need to create a query to display prices for a material in different periods. 
    The user will enter a period interval.  For each period, they want to know the material price the last day of that period.
    Material price is a time-dependat attribute of material, and I created one formula variable to display it. The problem is the using the key-date of the query only works for a date, but not for severals.
    Is there any other way to do it?
    If not, the only solution I find is to have in the infoprovider the prices that I need, but I don't think this is a good practice.
    Any suggestions?
    Thanks!

    I have just seen something: in fact the created lines are:
    Key1   Compound1   fromdate    todate    attr1      attr2
    0001      L      01.01.1000      01.01.2006          <empty
    so as you can see, the right interval is created but the attributes are not up to date.
    Cheers.
    Cyril.

  • Query /report asking for input ? in Apex

    Hello all, my name is John and I am asking for help with the following,
    I am new to Oracle, Apex and SQL, PL/SQL (as you can tell from my query below.)
    I have the very basics of Apex (in that of making reports,forms etc).
    I created this query on a view in SQL Developer where it is asking for start and end dates to filter the report. , which is what I want it to do and returns the results I want.
    Now I would like to create a report in Apex where it asks for the between dates as it does in the posted query, When that is done I want to pass it to the bipublisher report for pdf printing.
    I am running this query as a totals report already (without the line with WHERE clause query asking of course.) in an apex application, crude as it may be.
    I have it running as a Interactive reports and can filter the dates that way of couse but I want to learn to create the user input type query/report in Apex.
    I have been reading that I would need to use a "pl/sql anonymous block with a "declare' and a page process?. (gettting confused in the "declare" variables and the execute sections)
    I have looked at numerous samples and still do not quite getting the blocks down.
    If you could point me in the right direction of where to go or better yet if someome could show me coding on how to get this to work in apex report/query (s)?
    Slow learn I guess
    I am using APEX 3.1.2 on 11g database.
    Thanks in advance for help on this.
    ++++++++++++++++++++++++++++++++++++
    ----query for truck totals from view-----------
    ,select
    trucktotals.truck_number as "Truck Number",
    trucktotals. truck_type as "Truck Type",
    sum (trucktotals.end_miles-trucktotals.begin_miles) as "Total Miles",
    sum (trucktotals.reg_hours+trucktotals.ot_hours) as "Total Hours",
    sum (trucktotals.total_net_tons) as "Total Tons",
    avg (trucktotals.equip_rent) as "EQR P_HR"from "trucktotals"
    <strong>where trucktotals.wage_date between to_date(:Start_date) and to_date(:end_date)</strong>
    group by trucktotals.truck_number, trucktotals.truck_type
    order by trucktotals.Truck_Number----end query for truck totals from view------------------+++++++++++++++++++++++++++++++++++++
    Edited by: [email protected] on Oct 31, 2008 12:49 PM
    Edited by: [email protected] on Oct 31, 2008 12:53 PM
    Edited by: [email protected] on Oct 31, 2008 12:54 PM

    Hi Martin,
    Thank you for the information, it is a real help to me and gives me more insight toward my learning .
    It took me little while , the condition had to be modified a little bit
    (had to put parentheses around the :PXXX_START_DATE .... END_DATE, and remove the period to get it to work).
    where (:PXXX_START_DATE) is not null and (:PXXX_END_DATE) is not null
    It does work to the sense it shows the start and end date fields and the button and the report results below that, and you can enter the dates and the results change.
    Looking at my question, I should have been a little more clear in the fact I want query to ask for the dates first in a pop up type window, when you press the "Show Report" button,
    and then branches off to show the report. That is the reason I think, I referred to a block or procedure to acomplish this?
    Thanks and still learning
    John

  • 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.

  • Query for between two dates.

    Hi,
    I've a column of date, and I want to select the records between two dates, the output of this columns is: 08/19/2003 2:11:00 AM
    My query is:
    SELECT DTM FROM ITEM
    WHERE DTM BETWEEN '07/01/2012' AND '07/15/2012'
    Please help.
    Thanks,

    >
    I've a column of date, and I want to select the records between two dates, the output of this columns is: 08/19/2003 2:11:00 AM
    My query is:
    SELECT DTM FROM ITEM
    WHERE DTM BETWEEN '07/01/2012' AND '07/15/2012'
    Please help.
    >
    Help with what? You didn't ask a question or indicate if you are having a problem of some sort.
    Did you need to know how to use TO_DATE instead of literals in the WHERE clause?
    SELECT DTM FROM ITEM
    WHERE DTM BETWEEN TO_DATE('07/01/2012', 'MM/DD/YYYY') AND TO_DATE('07/15/2012', 'MM/DD/YYYY');

  • How to calculate the month difference between two date char. in Query?

    Customers would like to see how many months passed between two date type of characteristics (e.g., the month difference between the current date and the scheduled delivery date in the record) and put the result into the column as KF. 
    We would have to grab the fiscal year/period kind of value and then do the subtraction, e.g., if the current date value is 2/28/2008 and the scheduled delivery date value in the record is 12/01/2007, the correct result should be 2 month difference between these two date values, but could someone here give us the technical light on how to make this happen in query design?
    Thanks and we will give you reward points for the correct anwsers!

    Hi Kevin,
    The Badi is RSR_OLAP_BADI.
    You can create an implementation using Transaction  SE18.
    The implementation is per cube and is defined in the filters.
    In the Implementation you have the following methods :
    1. Define : Here you will provide the Keyfigure you need as a virtual one.
    2. Initilialize : Any Init Function you want to do.
    3. Compute. This is called per datarecord and here you can cimpute your value.
    Hope this helps.
    Pralay Ahluwalia

  • Need MDX query to find something like date diff and Date Range for last 10 days

    Hi ,
    I need two Query .First Query for below;
    I have below data in table like.
    Cat      StartDate    EndDate     
    A    2000-01-01     2000-01-15   
    B    2000-01-02     2000-01-30    
    C    2000-01-01     2000-01-31    
    D    2000-02-01     2000-02-28    
    A    2000-01-10     2000-01-31    
    I need if Startdate and Date completes whole one month then set status =1 else  0 using MDX query.
    like this ;
    Cat      StartDate    EndDate       Status
    A    2000-01-01     2000-01-15    1
    B    2000-01-02     2000-01-30    0
    C    2000-01-01     2000-01-31    1
    D    2000-02-01     2000-02-28    1
    A    2000-01-10     2000-01-31    1
    In second query I need last 10 days from current days like;
    Now = 8/20/2014
    output will be ;
    8/20/2014
    8/19/2014
    8/18/2014
    8/17/2014
    8/16/2014
    8/15/2014
    8/14/2014
    8/13/2014
    8/12/2014
    8/11/2014
    8/10/2014
    Please help me .
    Thanks

    Hi Prajapati,
    In your scenario, you can use Properties and Datediff function to achieve your requirement. Since not know the structure of your cube, we cannot give you the esact query.
     I have tested it on the AdventureWorks cube, the query below is for you reference.
    WITH MEMBER [Measures].[StartDate]
    AS
    [Employee].[Employee Department].CURRENTMEMBER.PROPERTIES('Start Date')
    MEMBER [Measures].[WorkYear]
    AS
    DATEDIFF('yyyy',[Measures].[StartDate],NOW())
    MEMBER [Measures].[Status]
    AS
    IIF(DATEDIFF('yyyy',[Measures].[StartDate],NOW())>10,1,0)
    SELECT {[Measures].[StartDate],[Measures].[WorkYear],[Measures].[Status]} ON 0,
    [Employee].[Employee Department].[Employee].MEMBERS ON 1
    FROM [Adventure Works]
    Results
    Reference
    http://msdn.microsoft.com/en-us/library/ms144821.aspx
    Regards,
    Charlie Liao
    TechNet Community Support

  • How to query two data blocks simultaneously?

    Dear all,
    Need your inputs on the following problem statement...
    Existing Functionality:
    We have two data blocks A (Parent) and B (Child) in a relationship. Both data blocks refer to different tables.
    Data block A is the query data block and for a single record in block A we can have multiple records in block B. Multiple records in block B are shown one at a time after executing a query, this is implemented by using a list item C (belongs to a third block).
    For example
    Let us say block B can have 5 different types of entries for each record in block A. In this case the list item C will have 5 values corresponding to these entries. Once the query is executed, block B will show the default entry for the queried record in block A. To see other entries for the record user can select the required value in list item C and corresponding entry in block B will be fetched.
    Requirement:
    Our requirement now is to enable querying upon both data blocks A and B simultaneously. To implement this I replaced data blocks A and B with a single data block X which is based on the join of the two tables referred by the Data blocks A and B earlier. As the fields should allow insert, update, delete operations we did not use a view here.
    Issue:
    Now the problem is, each record in block A for which block B had multiple entries earlier is now getting listed multiple times because of the join.
    I have tried but could not find any solution for this. I would appreciate if any of you can suggest how we can query both blocks simultaneously without affecting the existing functionality.
    Thanks,
    Amit

    I don't understand your requirement in detail. I try to repeat what i understood so far.
    You have a master-block A based on a table A and a detail-block B based on a table B. So far so good. You can now query based on conditions just the datablock A, because B is a detail and therefore can only be queryied in context of block A.
    Your reuirement is to query on both blocks A and B and find block in B also without giving conditions for the relevant block A.
    Is it that ?
    What i don't understand, what is block C used for?
    An idea for the querying of block B's data: Create Non-database-items items in block A for the search-criteria you need on block B and make them Queryable.
    In the PRE-QUERY-trigger on block A build a WHERE-condition if that search-criteria is entered, something like
    IF :BLOCK_A.SEARCH_CRITERIA_FOR_BLOCK_B IS NOT NULL THEN
      SET_BLOCK_PROPERTY('BLOCK_A', ONETIME_WHERE, 'WHERE PKVALUE IN (SELECT FKVALUE_TO_A FROM TABLE_B WHERE FIELDVALUE=' ||:BLOCK_A.SEARCH_CRITERIA_FOR_BLOCK_B)');
    END IF;This would query also records to A for which you want to have the B-records. So you could keep block-structure up to master-detail.

  • Query for finding data during special holidays

    Hi, i have a table for special holidays that looks like this:
    PROFILE_DAY
    VAR_DATE
    REGULAR_HOLIDAY
    1/1/2013
    H_WEEK_THURSDAY
    3/28/2013
    H_WEEK_FRIDAY
    3/29/2013
    REGULAR_HOLIDAY
    12/24/2013
    REGULAR_HOLIDAY
    12/25/2013
    REGULAR_HOLIDAY
    12/31/2013
    And another table (LOAD_PROFILE_TEST), which contains LOAD_PROF1 values from (TIME_EQ) 0 to 24 at intervals 0.25 for (PROFILE_DAY) MONDAY to SUNDAY including REGULAR_HOLIDAY, H_WEEK_THURSDAY and H_WEEK_FRIDAY.  All in all, this table contains 970 records (97 records between 0 to 24 with interval of 0.25 per PROFILE_DAY, with 10 distinct PROFILE_DAY).
    TIME_EQ
    PROFILE_DAY
    LOAD_PROF1
    LOAD_PROF2
    0
    REGULAR_HOLIDAY
    11.47
    0.25
    REGULAR_HOLIDAY
    11.27
    0.5
    REGULAR_HOLIDAY
    11.3
    0.75
    REGULAR_HOLIDAY
    11.08
    0
    MONDAY
    11.27
    0.25
    MONDAY
    11.33
    0.5
    MONDAY
    11.18
    Now, I have this query to update value of LOAD_PROF2 of the said table whenever parameters V_DATE_OUT & V_DATE_IN is entered:
    UPDATE LOAD_PROFILE_TEST
         SET LOAD_PROF2 = LOAD_PROF1 + :LOAD_DIFF
         WHERE  UPPER(PROFILE_DAY) IN (select UPPER(to_char(:V_DATE_OUT + (level-1), 'fmDAY'))
                       from  dual
                       connect by level <=  :V_DATE_IN - :V_DATE_OUT  + 1
    where :LOAD_DIFF is a certain pre-determined value.
    This query works fine if i am trying to update regular days from MONDAY to SUNDAY.  What i would like to do is to determine if the two parameter dates, V_DATE_OUT & V_DATE_IN would fall under any of the holidays on the first table LOAD_PROFILE_TEST, then update only those rows.  For example, V_DATE_OUT = 12/02/2013, Monday and V_DATE_IN = 12/06/2013, Friday.  The query above would update the values of LOAD_PROF2 for PROFILE_DAY -  MONDAY to FRIDAY, corresponding to dates 12/02/2013 and 12/06/2013.  If however, V_DATE_OUT = 12/23/2013, Monday and V_DATE_IN = 12/27/2013, Friday, this should update the rows corresponding to PROFILE_DAY - MONDAY for 12/23/2013, THURSDAY for 12/26/2013, FRIDAY for 12/27/2013, and REGULAR_HOLIDAY for the dates 12/24/2013 and 12/25/2013 since these two are included in the first table (table of holidays).  This same scenario will work the same way when V_DATE_OUT  and/or V_DATE_IN fall in the dates 3/28/2013 and 3/29/2013.  All other dates not included in the table for special holidays will be treated according to the day they fall on (Monday thru Sunday).  I hope my point is clear.  Thank you in advance.

    Thanks for your reply.  Firstly, I am using Forms [32 Bit] Version 10.1.2.0.2 (Production).  I will try to explain a little further but I don't know if i can give the exact details of the tables since this would be voluminous. First i have a table REG_HOLIDAYS, whcih contain the following:
    PROFILE_DAY
    VAR_DATE
    REGULAR_HOLIDAY
    1/1/2013
    H_WEEK_THURSDAY
    3/28/2013
    H_WEEK_FRIDAY
    3/29/2013
    REGULAR_HOLIDAY
    12/24/2013
    REGULAR_HOLIDAY
    12/31/2013
    REGULAR_HOLIDAY
    12/25/2013
    Now i have another table LOAD_PROFILE_TEST which i will simplify just to show what i wanted to do:
    CREATE
    TABLE LOAD_PROFILE_TEST
    TIME_EQ
    NUMBER (5, 2),
    PROFILE_DAY
    VARCHAR2 (15 BYTE),
    LOAD_PROF1
    NUMBER (6, 2), 
    LOAD_PROF2
    NUMBER (6, 2)
    Here are the sample values of this table:
    TIME_EQ
    PROFILE_DAY
    LOAD_PROF1
    LOAD_PROF2
    0
    Monday
    2
    0
    Tuesday
    2.1
    0
    Wednesday
    2.3
    0
    Thursday
    2.5
    0
    Friday
    2.2
    0
    Saturday
    2.4
    0
    Sunday
    2.3
    0
    Regular_holiday
    1.9
    0.25
    Monday
    2.1
    0.25
    Tuesday
    2.1
    0.25
    Wednesday
    2.4
    0.25
    Thursday
    2.2
    0.25
    Friday
    2.5
    0.25
    Saturday
    2.3
    0.25
    Sunday
    2.3
    0.25
    Regular_holiday
    2.5
    However, in the actual table, TIME_EQ will start with 0 until 24 with interval of 0.25 (i.e 0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, ...23.5, 23.75, 24).  So for a PROFILE_DAY of 'Monday', there will be 97 rows corresponding to TIME_EQ of 0 to 24.  The same is true for Tuesday, Wednesday until Sunday including Regular_holiday.  All in all, this table would contain 776 rows.  LOAD_PROF1 values are random values initally inputted with PROFILE_DAY and TIME_EQ.
    The first goal is to UPDATE this table (LOAD_PROFILE_TEST) by updating the column LOAD_PROF2 by adding a certain parameter value, :LOAD_DIFF, say 0.1. Now, i will have two scenarios to show what i would like to happen.  First, i have two date parameters :V_DATE_OUT and :V_DATE_IN.
    First Case, V_DATE_OUT = 12/15/2013 (Monday); V_DATE_IN = 12/22/2013 (Sunday)
    I will have this query to update said table:
    UPDATE LOAD_PROFILE_TEST
           SET LOAD_PROF2 = LOAD_PROF1 + :LOAD_DIFF
       WHERE   UPPER(PROFILE_DAY) IN (select UPPER(
                                                                     to_char(
                                                                          :V_DATE_OUT + (level-1),
                                                                          'fmDAY'))
                                                                    from  dual
                                                     connect by level <=
                                                           :V_DATE_IN - :V_DATE_OUT  + 1);
    The output of this query would be:
    TIME_EQ
    PROFILE_DAY
    LOAD_PROF1
    LOAD_PROF2
    0
    Monday
    2
    2.1
    0
    Tuesday
    2.1
    2.2
    0
    Wednesday
    2.3
    2.4
    0
    Thursday
    2.5
    2.6
    0
    Friday
    2.2
    2.3
    0
    Saturday
    2.4
    2.5
    0
    Sunday
    2.3
    2.4
    0
    Regular_holiday
    1.9
    0.25
    Monday
    2.1
    2.2
    0.25
    Tuesday
    2.1
    2.2
    0.25
    Wednesday
    2.4
    2.5
    0.25
    Thursday
    2.2
    2.3
    0.25
    Friday
    2.5
    2.6
    0.25
    Saturday
    2.3
    2.4
    0.25
    Sunday
    2.3
    2.4
    0.25
    Regular_holiday
    2.5
    Since, 12/15/2013 up to 12/22/2013 is from Monday to Sunday without having a particular day included in the first table, REG_HOLIDAYS, therefore all the rows with Monday to Sunday are updated.
    Second Case, V_DATE_OUT = 12/23/2013 (Monday); V_DATE_IN = 12/29/2013 (Sunday)
    Take note that 12/24 and 12/25 are included in the first table, REG_HOLIDAYS, therefore i need a query so that this would be my output afterwards:
    TIME_EQ
    PROFILE_DAY
    LOAD_PROF1
    LOAD_PROF2
    0
    Monday
    2
    2.1
    0
    Tuesday
    2.1
    0
    Wednesday
    2.3
    0
    Thursday
    2.5
    2.6
    0
    Friday
    2.2
    2.3
    0
    Saturday
    2.4
    2.5
    0
    Sunday
    2.3
    2.4
    0
    Regular_holiday
    1.9
    2.0
    0.25
    Monday
    2.1
    2.2
    0.25
    Tuesday
    2.1
    0.25
    Wednesday
    2.4
    0.25
    Thursday
    2.2
    2.3
    0.25
    Friday
    2.5
    2.6
    0.25
    Saturday
    2.3
    2.4
    0.25
    Sunday
    2.3
    2.4
    0.25
    Regular_holiday
    2.5
    2.6
    As can be seen, since 12/23/2013 up to 12/29/2013 is from Monday to Sunday, rows with Monday upto Sunday should be updated, HOWEVER, since 12/24 and 12/25 which falls on a Tuesday and a Wednesday also were declared as holidays (included in the REG_HOLIDAYS table),  instead of updating rows with PROFILE_DAY of Tuesday and Wednesday, the query should instead update rows with Regular_holiday as PROFILE_DAY and leave as is the rows with Tuesday and Wednesday.  Additional note, days declared in the REG_HOLIDAYS table with PROFILE_DAY of Regular_holidays are treated as DISTINCT as in the case of 12/24 and 12/25.
    The query you gave me gives the correct value if the involved days between V_DATE_OUT and V_DATE_IN is from Monday to Sunday only, otherwise it always gives Regular_holiday only regardless of the other dates queried.  As in the first case above, it would give Monday to Sunday (correct) but for the second case, it will only give Regular_holiday, the other days (Monday, Thursday, Friday, Saturday and Sunday) was not outputted.
    I hope this became clearer since i will still be needing this for another query which i will inquire again after resolving this issue.  Thanks a lot for your help.

  • Can we implement the custom sql query in CR for joining the two tables

    Hi All,
    Is there anyway to implement the custom sql query in CR for joining the two tables?
    My requirement here is I need to write sql logics for joining the two tables...
    Thanks,
    Gana

    In the Database Expert, expand the Create New Connection folder and browse the subfolders to locate your data source.
    Log on to your data source if necessary.
    Under your data source, double-click the Add Command node.
    In the Add Command to Report dialog box, enter an appropriate query/command for the data source you have opened.
    For example:
    SELECT
        Customer.`Customer ID`,
        Customer.`Customer Name`,
        Customer.`Last Year's Sales`,
        Customer.`Region`,
        Customer.`Country`,
        Orders.`Order Amount`,
        Orders.`Customer ID`,
        Orders.`Order Date`
    FROM
        Customer Customer INNER JOIN Orders Orders ON
            Customer.`Customer ID` = Orders.`Customer ID`
    WHERE
        (Customer.`Country` = 'USA' OR
        Customer.`Country` = 'Canada') AND
        Customer.`Last Year's Sales` < 10000.
    ORDER BY
        Customer.`Country` ASC,
        Customer.`Region` ASC
    Note: The use of double or single quotes (and other SQL syntax) is determined by the database driver used by your report. You must, however, manually add the quotes and other elements of the syntax as you create the command.
    Optionally, you can create a parameter for your command by clicking Create and entering information in the Command Parameter dialog box.
    For more information about creating parameters, see To create a parameter for a command object.
    Click OK.
    You are returned to the Report Designer. In the Field Explorer, under Database Fields, a Command table appears listing the database fields you specified.
    Note:
    To construct the virtual table from your Command, the command must be executed once. If the command has parameters, you will be prompted to enter values for each one.
    By default, your command is called Command. You can change its alias by selecting it and pressing F2.

  • Select Query Between two dates...

    Hi Guru's,
    I need a Select Query between two dates, also if the record not found for any in between date then it should return NULL or 0 ...
    for Example
    1. I am having two records in DB for date 2-10-2008 & 4-10-2008
    2. Now suppose I have given Query for date between 1-10-2008 to 5-10-2008
    Then it should return me 5 records with valid values for 2 & 4 and NULL for other 1,3,5
    Thanks.

    Try like this:
    with
      t as
          select date '2008-10-02' as dt, 'Record #1 (in DB)' as str from dual union all
          select date '2008-10-04' as dt, 'Record #2 (in DB)' as str from dual
    select v.dt, t.str
      from (
             select date '2008-10-01' + level - 1 as dt
               from dual
             connect by level <= (date '2008-10-05' - date '2008-10-01') + 1
           ) v
      left join t
        on v.dt = t.dt
    order by 1

  • Same query takes different time for two different users with same privileges

    Hi,
    Just wanted to know if it is possible for an INSERT query to take different amount of time for two different users for the same volume of data. If so, what could be the reason? I would like to add that we are not executing the query simultaneously. But it is always faster for user1(within 10-20 seconds) and slower for user2(takes around 8-10 minutes).

    Show execution plan for each user. I think there is other reasons which you didn't not tell

  • Filter Information for two parameters in Query Designer

    Hi Gurus !!
    I have a problem for filter information for two parameters in Query Designer,
    the first parameter correspond a Ejercise-Period, the second parameter correspond
    a Compensation Date of document, both parmeters must have date less than or equal to
    to the parameter date input for screen (mm.aaaa).
    Internally the Report must filter countable information for Countable Date <= Parameter Input and
    Compensation Date of document <= Parameter Input.
    If i assign two filter parameter in Query Designer, not could realise this.
    Exist any simple form to realise this ??
    Wait for yours responses.
    Thank You.

    Hi shanthi bhaskar,
    Thanks a lot for your answer.
    I have one doubt about it:  with this solution that you propoused the user will be able to select the values for plant?.
    I mean, the user make the selection of the value for Zone, then he wants to see the in plan´s variable the values that corresponds with this Zone for make a new selection of plan.
    What happens if I need this dependency also in another variable like time variable?
    Thanks  a lot

Maybe you are looking for

  • How to embed a video from my desktop in Muse

    I would like to embed a video from my desktop into Adobe Muse. Can anyone help? Is there a certiain type of video that Muse only uses?

  • How to move the cursor in a text input programatically

    Hi, I am using a TextInput field and a my own keyboard UI with buttons for each alphabet. When the user presses buttons on the keyboard UI, i populate the TextInput field through data binding. But I would want the cursor to move as the characters are

  • Are there any ways to increase security in ODI

    Hi, Are there any other ways to increase security in ODI. I have heard about External password storage, External authentication and SSO from over here: http://docs.oracle.com/cd/E17904_01/integrate.1111/e12643/whatsnew.htm#CHDEAIAB apart from these a

  • Discoverer worksheet: working with data between multiple sheets

    Hi All, Is there a way to use data between multiple discoverer worksheets? What I am trying to do is combine data from different worksheets and display that data in another sheet. I believe it is not possible in discoverer at the moment (I might be w

  • Get all sap users based on company code

    Hi, In my workflow i need an activity which will popup all sap users based on the company code. can anyone guide me by giving the table which is having relationship between sap user and company code. Any direct relation or indirect relation? Thanks s