Date parameters for Date range

Hi,
I got a report with 2 parameters From Date and To Date and i have 2 columns items in the report absence start date and absence end date.
i have to make sure that the date range satisfies all case's
what is the best way that I can these validation rules in discoverer on these dates...?
case's are something like this:
1 (absence start date > from date; absence end date > to date)
2 (absence start date > from date; absence end date < to date)
3 (absence start date < from date; absence end date > to date)
4 (absence start date > from date; absence end date < to date)
Any help would be really appreciated.

Using conditions in Discoverer is just like specifying a where clause in SQL with AND and OR. You should be able to use conditions for what is being described below.
Are you not able to do that using conditions in your report ?

Similar Messages

  • Report for a date range

    Hi,
    My end user requires me to develop a report that will accept the following parameters:
    Customer Code : ABC
    From Period : 01-Jan-2005
    To Period : 31-Dec-2010
    Output must be as follows :
    Customer Jan-05 Feb-05 Mar-05 Apr-05 May-05 ......................................Dec-10 Total Order
    Code
    ABC 10 15 5 20 10 ...................................... 15 X value
    I have told my end user that it is not possible to create an Oracle report that will give data for any period range that the user specifies. First the number of columns for the date range must be fixed like say at a time only data for 12 months will be displayed in the report. Then they can run the report for any year and the parameter has to be
    Customer Code : ABC
    Year :2005
    The output will be :
    Customer Jan-05 Feb-05 Mar-05 Apr-05 May-05 ......................................Dec-05 Total Order
    Code
    ABC 10 15 5 20 10 ...................................... 15 X value
    Am I right or wrong ? Please advise. This is very urgent.

    I don't see why this should not be possible.
    Remember that you can have repeating frames in every direction (ie. right and down) and can combine these.
    What I would do is look for (or create) a type of calender-table where I could select the date values from (ie. JAN 05) qualified by the from- and to-Parameters (aka query1),
    then have a second, dependent query which uses the date from the calender (aka query2).
    Then stack a down repeating frame for query2 into the right repeating frame for query1 and you should be almost there... Use the date from query1 as heading...
    Cheers,
    Jens Rettig

  • How to get XLR to show BPs with no transaction data for a given date range

    Hi -
    I am building an XLR report that does a comparison of net sales data across two periods for a given sales employee's BPs.
    The report has the row expansion:
    FACT BPA(*) SLP(SlpName = "ASalesPersonNameHere") ARDT(Code = "ARCreditMemo", "Invoice") Group by BPA.CardName
    and column expansions:
    FIG(SO_TaxDate = @StartDate:@EndDate)
    and
    FIG(SO_TaxDate = @StartDate2:@EndDate2)
    where @StartDate, @EndDate, @StartDate2, @EndDate2 are parameters that define the two ranges of dates.
    The column formulas are, from left to right:
    =ixDimGet("BPA", "CardName")
    =ixGet("SO_DocTotal")      <-- filtered by column expansion for first date range
    =ixGet("SO_DocTotal")      <-- filtered by column expansion for second date range
    The report works fine except for one problem, I would like it to include BPs for which no transaction occurred in either date range as well.
    Any help is greatly appreciated!
    Thanks,
    Lang Riley

    Really appreciate your feedback!  Those are good suggestions. I should have mentioned that I had already tried both those suggestions.
    Removing FACT on BPA in this case ends up returning all the BPs and not respecting the SLP(SlpName = "aName") part of the query. 
    Using **, i.e., * or #NULL, makes no change in the resulting data in this case.  I had thought that ** would be the solution, but it didn't change the outcome.  I still have BPs for which when their sales employee is used as the filter and they have no transactions for either date range, and yet they still do not appear. 
    I should further mention that the IXL query, as it now stands, does return BPs for which one of the periods has no data, just not both, and I have verified that applicable BPs with no transaction data for both periods do exist in my data set.  It seems that perhaps the IXL query needs to be restructured?  Please keep the suggestions coming including how this query might be restructured if necessary.

  • How can I make CONTAINS query work for a date range

    In either 9i or 10g (eventual). I have a CONTEXT index that contains multiple columns from multiple tables and using a USER_DATASTORE. E.g., I have names that come from 3 different table locations and dates that come from 4. I can index them fine but how can I perform a single consolidated CONTAINS query against the single CONTEXT index to do the following:
    smith WITHIN lname AND john WITHIN fname AND dob BETWEEN '19870315' and '19970315'
    I know that I can use a mixed query but this is inefficient (esp since I have birth dates in multiple tables). Is there any algorithm for a range operator (>, <, between?) within the CONTAINS operator?
    CTXCAT index is not an option, as I have many text columns I am searching.
    Thanks!

    When you run the cdstore.sql, in addition to creating the ctx_cd package, it also creates the friedman package that contains the algorithm that the ctx_cd package uses. You could use the functions from that friedman package in your procedure for your user_datastore and in the creation of your query string, as demonstrated below.
    SCOTT@orcl_11g> CREATE OR REPLACE PROCEDURE my_proc
      2    (p_rowid IN           ROWID,
      3       p_clob     IN OUT NOCOPY CLOB)
      4  AS
      5  BEGIN
      6    FOR r IN
      7        (SELECT emp.ename, emp.job, emp.hiredate, dept.dname
      8         FROM      emp, dept
      9         WHERE  emp.deptno = dept.deptno
    10         AND      emp.ROWID = p_rowid)
    11    LOOP
    12        DBMS_LOB.WRITEAPPEND (p_clob, 7, '<ename>');
    13        DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (r.ename), r.ename);
    14        DBMS_LOB.WRITEAPPEND (p_clob, 8, '</ename>');
    15        DBMS_LOB.WRITEAPPEND (p_clob, 5, '<job>');
    16        DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (r.job), r.job);
    17        DBMS_LOB.WRITEAPPEND (p_clob, 6, '</job>');
    18        DBMS_LOB.WRITEAPPEND (p_clob, 7, '<dname>');
    19        DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (r.dname), r.dname);
    20        DBMS_LOB.WRITEAPPEND (p_clob, 8, '</dname>');
    21        DBMS_LOB.WRITEAPPEND (p_clob, 10, '<hiredate>');
    22        -- apply friedman algorithm to date column ------------------
    23        friedman.init
    24          (TO_NUMBER (TO_CHAR (TO_DATE (19000101, 'YYYYMMDD'), 'J')),
    25           TO_NUMBER (TO_CHAR (TO_DATE (21001231, 'YYYYMMDD'), 'J')));
    26        DBMS_LOB.WRITEAPPEND
    27          (p_clob,
    28           LENGTH (friedman.encodedate (r.hiredate)),
    29           friedman.encodedate (r.hiredate));
    30        --------------------------------------------------------------
    31        DBMS_LOB.WRITEAPPEND (p_clob, 11, '</hiredate>');
    32    END LOOP;
    33  END my_proc;
    34  /
    Procedure created.
    SCOTT@orcl_11g> SHOW ERRORS
    No errors.
    SCOTT@orcl_11g> BEGIN
      2    CTX_DDL.CREATE_PREFERENCE ('my_datastore', 'USER_DATASTORE');
      3    CTX_DDL.SET_ATTRIBUTE      ('my_datastore', 'PROCEDURE', 'my_proc');
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> CREATE INDEX my_index ON emp (ename)
      2  INDEXTYPE IS CTXSYS.CONTEXT
      3  PARAMETERS
      4    ('DATASTORE     my_datastore
      5        SECTION GROUP CTXSYS.AUTO_SECTION_GROUP')
      6  /
    Index created.
    SCOTT@orcl_11g> EXEC DBMS_STATS.GATHER_TABLE_STATS (USER, 'DEPT')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> EXEC DBMS_STATS.GATHER_TABLE_STATS (USER, 'EMP')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> VARIABLE cstring VARCHAR2(4000)
    SCOTT@orcl_11g> BEGIN
      2    :cstring := 'smith WITHIN ename';
      3    :cstring := :cstring || ' AND ' || 'clerk WITHIN job';
      4    :cstring := :cstring || ' AND ' || 'research WITHIN dname';
      5    -- apply friedman algorithm to search criteria ---------------------------
      6    friedman.init
      7        (TO_NUMBER (TO_CHAR (TO_DATE (19000101, 'YYYYMMDD'), 'J')),
      8         TO_NUMBER (TO_CHAR (TO_DATE (21001231, 'YYYYMMDD'), 'J')));
      9    :cstring := :cstring || ' AND ((' ||
    10               friedman.integercontainscriteria
    11                 (TO_NUMBER (TO_CHAR (TO_DATE ('19800315', 'YYYYMMDD'), 'J')),
    12                  TO_NUMBER (TO_CHAR (TO_DATE ('19810315', 'YYYYMMDD'), 'J')),
    13                  'B')
    14               || ') WITHIN hiredate)';
    15    ---------------------------------------------------------------------------
    16  END;
    17  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> SET AUTOTRACE ON EXPLAIN
    SCOTT@orcl_11g> SELECT *
      2  FROM   emp
      3  WHERE  CONTAINS (ename, :cstring) > 0
      4  /
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
    Execution Plan
    Plan hash value: 1887222286
    | Id  | Operation                   | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |          |     1 |    37 |     4   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMP      |     1 |    37 |     4   (0)| 00:00:01 |
    |*  2 |   DOMAIN INDEX              | MY_INDEX |       |       |     4   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("CTXSYS"."CONTAINS"("ENAME",:CSTRING)>0)
    SCOTT@orcl_11g>

  • Howto add date range parameters to linechart?

    I'm using SQL Server 2014 and SSDT 12. I have a linechart generated using three fields - FCP, NFS (both integers) and TimeIndex (the datetime over 30 days).
    I see how to add parameters but how do I allow users to specify a date range? For example to only view data from 01/12/2014 - 07/12/2014.
    Thanks in advance
    Adam

    Found this myself eventually in case anyone else needs it:
    http://100rov.blogspot.co.uk/2012/12/create-calendar-parameter-with-start.html

  • Creating Date Range Parameters

    Hi,
    I have created the date range parameter using the parameter fields, but when I refresh the report the data does not get affected. It gives the same result as it would have given without the date parameter. What needs to be done in order for the parameter to actually work.?
    Thanks

    By adding a parameter you just defined a variable/ condition. Now when you want to display your results based on the values selected, you mean to implement a condition , similar to where clause in usual queries.
    For this we use the record selection formula, meaning to say the records would be selected based on those conditions.
    For eg. You are using the date range and you want to display data falling within those date range. That is you need to create a condition :
    1. What condition u2013 you have already created the parameters
    2. Implement that in where clause u2013 you need to create a record selection formula (menu Report -> Selection Formulas -> Record )
    You may probably need to use something like : in {?DateFrom} to {?DateTo}

  • Optional date range parameters

    Hi All,
    I have a 2 parameters from date and to date.When I didn't selected anything in parameters list then it should show all dates data.
    Please suggest how to create a optional parameter for date range parameters.

    Hi Sastry,
    For getting optional date parameter we are using formula like this  in record selection
    Not(hasvalue({?Date})) OR ({employee.Date} = {?Date})
    But the solution you provided doesn't contain not .Can you please suggest what is the difference.

  • How to change bucket capacity for a certain date range (duration)?

    Hi,
    I need to update the bucket capacities of Resource at Vendor location in APO live cache for a particular period using BAPI_RSSRVAPS_CHANGEMULTI.
    Here I am executing BAPI by passing -
    Import Parameters:
    LOGICAL_SYSTEM
    COMMIT_CONTROL
    PLANNING_VERSION
    Tables:
    RESOURCE_HEAD
    (RESOURCE = Resource  " Test123
    LOCATION = Vendor Number/Loctaion
    CAPACITY_A = 5000.000
    NUM_OF_PERIODS = 001
    PERIOD = 02    " Day Wise
    UTIL_BUCKET = 100.000 )
    RESOURCE_HEAD_X
    (All corresponding fields X)
    RESOURCE_QUANMODEL
    (RESOURCE = Resource  " Test123
    VERSION = 01
    ENDDA = 02/25/2011
    BEGDA = 02/21/2011
    QUANMODEL = 8000 )
    RESOURCE_QUANMODEL_X
    (All corresponding fields X)
    [ I have a capacity variance:
    Resource = Test123; Capacity Varient = 01; Valid From = 02/21/2011
    Valid To = 02/25/2011; Bucket Util Rate = 100.000; Qty/Rate definition = 8000 ]
    Now, while I execute /SAPAPO/RES01 to display Capacity for that resource-Location-PlanningVersion, Its showing that 'Bucket Capacity' and 'SNP Bucket Capacity' get changed into 5000. But this change happend for all the days and not only for the duration I passed into Bapi (From BEGDA to ENDDA).
    How to change bucket capacity for a certain date range (duration)? Any help please.
    Thanks
    Roy

    I did it myself. Hence closing the thread.
    Solution:
    1. Get RESUID from /SAPAPO/RESKEY table by passing Resource as NAME.
    2. Call Function Module /SAPAPO/CRES_QUANPROF_UPDATE
    3. Call Function Module /SAPAPO/CRES_SAVE_FROM_BT
    For further help, change manually a single record in the 'capacity profile' in TXN /SAPAPO/RES01 and debug both the FM mentioned above.
    BR
    Roy

  • How to calculate a week & Month in given date range (not for sele-options)

    Hi ,
      I have defined 2 date parameters in sel-screen (Plz remember that date variable are not a SELECT-OPTIONS).  Now i want ot display week nos & monts in output.
          Ex: date1: 20080101 & date2: 20080229. then
                    weeks : 1, 2, 3,---9.
                    months: jan-08, feb-08.
    Plz help me with block of code or any FM.
    Regards,

    Hi Srikanth,
            The FM HR_99S_INTERVAL_BETWEEN_DATES   is doesn't existing, but there is a fm HR_MX_INTERVAL_BETWEEN_DATES but it returns no of Years & Days.
           But i found some FM which r returns no of months for given date range. but my requirement is, want to display the month no bw 1 to 12. (ex: dat1=15-03-2008 & dat2= 01-06-2008 then in month fields 03,04,05 & 06. ).
    Plz help me on this.
    -Regards.

  • XL Reporter - Selection of date range for report templates

    Dear All,
    I want to create a report using XL reporter and attach it to the main SAP B1 reports module . For this I have created the template using report composer .
    Issue:
    I have only one sub-period (ie,year wise in the posting periods)
    how i can select the date range in the Composer and attach it to the main menu.
    Regards,
    Suresh Kannan.P.

    Suresh,
                1. Goto Report Designer
                2. there u can find "Advanced Report Builder" on left side of the window
                3. At the below u can find three buttons like "Parameters", "Properties","Apply"
                4. Click on "Parameters"
                5. then Parameters window will populate
                6. Click the new Button
                7. Name: give as u like
                    Category: Literal
                    Type: Date
                    Attribute: Leave blank
                    Default Vale: Leave Blank
                    Prompt: From Date
             This is the process to create the parameters.
    create two parameters. one is fdate and ldate.

  • Code or idea of adding date range parameters

    Thanks guys for answering all my past queries.
    Another question arises
    I don't know how to write code for date range value parameters for a report.
    i-e
    I have a report that takes a start date and end date range parameter.
    I can pass all the other parameters to CrystalReportViewer through code but dont know how to write code to pass date range parameters.
    Please help!

    Hi,
    I assume you are using JRC on CR XI or XI R2.
    For Single Range Values:
    Calendar calendar1 = Calendar.getInstance();
    calendar1.clear();
    calendar1.set(yyyy,mm,dd);
    Date date1 = calendar1.getTime();
    Calendar calendar2 = Calendar.getInstance();
    calendar1.clear();
    calendar.set(yyyy,mm,dd);
    Date date2 = calendar2.getTime();
    // use yyyy,mm,dd,hh,mm,ss for DateTime parameter.
    ParameterFieldValue rangeVal = createSingleRangeVal(date1, date2, RangeValueBoundType.inclusive, RangeValueBoundType.inclusive);
    paramFieldController.setCurrentValue("", "<Parameter Name>", rangeVal);
    For Multiple Range Values:
    Object [] beginVals = {date1, date2, date3};
    Object [] endVals = {date4, date5, date6};
    //Where  date1 - date4 is range 1, date2 - date5 is range 2 and date3 - date 6 is range 3.
    RangeValueBoundType [] beginBoundTypes = {RangeValueBoundType.inclusive, RangeValueBoundType.exclusive, RangeValueBoundType.noBound};
    RangeValueBoundType [] endBoundTypes = {RangeValueBoundType.noBound, RangeValueBoundType.inclusive, RangeValueBoundType.exclusive};
    ParameterFieldValue [] multiRangeVal = createMultiValRangeParameter(beginVals, endVals, beginBoundTypes, endBoundTypes);
    paramFieldController.setCurrentValues("", "<Parameter Name>", multiRangeVal);
    I hope this helps.
    Thanks
    Aasavari

  • Date range by week based on input parameters

    Afternoon folks -- I need to produce a report which will be displayed based on weeks.
    There are two input parameters: P_FROM_DATE and P_TO_DATE
    I need to find the date ranges in weeks starting on THURSDAY and ending on a WEDNESDAY. For example, if my P_FROM_DATE is 01-AUG-2012 and P_TO_DATE is 11-SEP-2012, I need to show the following weeks in this fashion:
    02-AUG-2012 - 08-AUG-2012
    09-AUG-2012 - 15-AUG-2012
    16-AUG-2012 - 22-AUG-2012
    23-AUG-2012 - 29-AUG-2012
    30-AUG-2012 - 05-SEP-2012
    06-SEP-2012 - 12-SEP-2012So, the idea is to start the first THURSDAY following the P_FROM_DATE and end on the WEDNESDAY preceding the P_END_DATE..
    Thanks!

    Hi,
    here's one way:
    WITH     params          AS
         SELECT  DATE '2012-08-01'     AS p_from_date
         ,     DATE '2012-09-19'     AS p_to_date
         FROM     dual
    ,     end_points     AS
         SELECT     TRUNC ( p_from_date + 4
                    , 'IW'
                    ) + 3          AS first_thursday
         ,     TRUNC ( p_to_date + 4
                    , 'IW'
                    ) - 5          AS last_wednesday
         FROM    params
    SELECT     first_thursday + (7 * (LEVEL - 1))     AS week_start_date
    ,     first_thursday + (7 * LEVEL) - 1     AS week_end_date
    FROM     end_points
    CONNECT BY     LEVEL     <= ( last_wednesday
                      + 1
                      - first_thursday
                      ) / 7
    ;TRUNC (dt) is the beginning of the ISO week that contains the DATE dt.
    The "magic number" 4 is used because the ISO week begins on Monday, 4 days later than your week begins, so
    TRUNC ( dt + 4
          , 'IW'
          )is the Monday in the same Thursday-Wednesday week as dt.

  • Function Module for separating a date range into days

    Hi all,
    Does anyone know if there is a function module which gives back the list of days when we give a date range as input parameter to the function module. For example, we enter the range 10.07.2006 - 13.07.2006 and the function module gives back a table  in form 10.07.2006, 11.07.2006, 12.07.2006, 13.07.2006.
    Thanks,
    Sükrü

    Hi suekrue,
    1. Exactly for this purpose,
       i have written an
       INDEPENDENT FORM (subroutine)
      wherein we pass
       a) fromdate
       b) todate
       c) ITAB
    2. and it gives all the dates in the internal table.
    3. just copy paste
    4.
    data :  itab type table of sy-datum with header line.
    parameters : fromdate type sy-datum default '20060701'.
    parameters : todate type sy-datum default sy-datum.
    perform getdays tables itab using fromdate todate.
    break-point.
    FORM
    form getdays
    tables itab
    using fromdate todate.
      data : curdate type sy-datum.
      curdate = fromdate.
      do.
        if curdate > todate.
          exit.
        endif.
        itab = curdate.
        append itab.
        curdate =  curdate + 1.
      enddo.
    endform.                    "getdays
    regards,
    amit m.

  • Dynamic Date Value for Date Range Parameter - Scheduling in BI

    Hi,
    I am New to BO Enterprise XI R3. I want to schedule the Crystal report which takes Date Range as parameter. Is any option available to calculate From Date automatically based on Current Date based on the range required?
    Currently, Parameter option accepts parameters and enterprise process the report for configured parameters. In this case, report always prints only for configured date range eventhough report generated after one month. I am expecting report has to print data for date range (eg. 1 weeks, 4 days, or any range) based on system current date.
    Thanks in Advance,
    Venkateswaran.P

    I'm am in the same situation.  I need to be able to have the date parameter dynamically change based on the current day's date when I schedule a report.  However, because this parameter comes from a Stored Procedure from the database, it cannot be modified in the Report Designer (as far as I know).  I've tried to set a default for it to use "currentdate" but it doesn't seem to take.  Anyone know if this can be accomplished in the scheduler?
    Thanks
    -Tom

  • Use formula for date range instead of parameter?

    I am designing a Crystal report that will always pull records for the next full week.
    Example:  Today is 8/4, so I need the report to pull data for dates 8/11 through 8/15.
    Currently, I am using parameters each time to run this report.
    Is there a formula that could automatically pull this date range without using parameters in my report?
    Any help is appreciated.
    Thanks.

    This is actually not too difficult.  Assuming you want to be able to run this on any date and get the "Next Full Week" starting on Monday (based on your date range above), here's what you could do:
    1.  Create a formula that I'll call {@StartDate}
    NumberVar dow := DatePart('w', CurrentDate, crMonday) - 1;  //Day of week, starting on Monday.
    NumberVar days := 7 - dow;
    CurrentDate + days
    2. Create a formula that I'll call {@EndDate}:
    {@StartDate} + 7
    3.  In the Select Expert, manually edit the selection formula to use these date formulas instead of the parameters.
    -Dell

Maybe you are looking for

  • After successful install, I am unable to use RoboHelp 7 because of constant refresh of file lists

    RoboHELP 7 installed on Windows XP Our enterprise support team installed RH7 on my new laptop via our corporate intranet.  I received an e-mail message reporting that the install failed so I contacted the support team, someone logged on to my machine

  • Updation of indicators in planning file MD21

    Dear Guru's, When the indicators inside the planning file entry (MD21) gets updated e.g. NTECH, NETPL & reset props. I observed that even for newly created materials these indicators are updated & for old materials which had gone through MRP run are

  • MSVCRT.DLL problem - missing DLL error

    I am interested if anyone else has run across the problem of post-installation error message referencing a missing MSVCRT.DLL dynamic link library even though several versions show up on the C: drive in various folders such as WIN32/SYSTEM? Also, the

  • I have a dell A940 printer. how do i hook up my macbook to it so i can print?

    I would like to print docs and photos from my macbook to my dell A940 printer. How do I do this? Also I have a clickfree external hard drive that I used to backup files from my old PC. I can't figure out how to select and make changes to or add to ip

  • DVD won't play in front row or dvd player

    After installing vlc player, i can watch dvd on the vlc, but front row and idvd player won't play them any more. I used to be able to watch dvd on front row and idvd, but since the instalation of vlc, it just won't play. any thoughts?