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}

Similar Messages

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

  • Oracle Lite: How to create data subsetting parameters?

    I need to know:
    how to create data subsetting parameters?
    I need these parameters for use of a restricting predicate in an item publication.
    I were looking the forum and i found topics about "how to set?" but i don't found how to create a data subsetting parameter.
    I am replacing SQL server 2000 and SQL server CE by oracle 9i and oracle lite 5.0.2.
    Thanks in advance.
    PCID

    Had problems with the parameters shown on pages webtogo in the datasubsettings section because none of them were "defined", but in sections 1.4.1.2 I found these lines:
    Template: select * from master.task where CustCity = :city
    Then click OK. This brings you back to the previous screen. The template query contains a variable (subscription parameter) named "city". Later, when you provision the application to a user, you will be prompted to enter the value for it.
    I found out how to put a parameter to restrict registries that download to the pocket pc from each user.
    Thank you very much!!!

  • 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

  • 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

  • Date range parameters are off by one day

    I have a Start Date and End Date parameter in my SSRS report.  The results are off by 1 day.  For example if I enter 4/2/2015 and 4/20/2015 it will return a few results from 4/1/2015 to 4/19/2015.  I think maybe it's a problem with my date
    conversion in T-SQL, but thought someone more experienced than me would have seen this before.
    Thanks

    Yes 
    The safest way to write a date range comparison would be as below
    WHERE DateField >= @StartDate
    AND DateField < DATEADD(dd,1,@EndDate)
    If you want results with @EndDate inclusive
    see more details here
    http://visakhm.blogspot.ae/2012/12/different-ways-to-implement-date-range.html
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Passing date range parameters in MDX Query

    Following is my mdx query
    SELECT NON EMPTY
        [Measures].[Cache Attendees Count]
    ON COLUMNS,
    NON EMPTY
        ([Cache Attendees].[Visit Id].[Visit Id].ALLMEMBERS *
        [Cache Attendees].[User Id].[User Id].ALLMEMBERS *
        [Cache Attendees].[Screen Name].[Screen Name].ALLMEMBERS *
        [Cache Attendees].[User Type Id].[User Type Id].ALLMEMBERS *
        [Cache Attendees].[User Type Name].[User Type Name].ALLMEMBERS *
        [Cache Attendees].[Group Date Count].[Group Date Count].ALLMEMBERS *
        [Cache Attendees].[Insert Time Stamp].[Insert Time Stamp].ALLMEMBERS )
        DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM
        SELECT
                STRTOMEMBER(@FromCacheAttendeesInsertTimeStamp) : STRTOMEMBER(@ToCacheAttendeesInsertTimeStamp)
            ) ON COLUMNS FROM (
            SELECT
                STRTOSET(@CacheAttendeesConferenceId) ) ON COLUMNS FROM [Cube_Attendee])
            WHERE ( IIF( STRTOSET(@CacheAttendeesConferenceId).Count = 1, STRTOSET(@CacheAttendeesConferenceId), [Cache Attendees].[Conference Id].currentmember ) )
    CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
    I want to filter my cube with three parameters
    1. @CacheAttendeesConferenceId
    2. @FromCacheAttendeesInsertTimeStamp
    3. @ToCacheAttendeesInsertTimeStamp
    When i pass following parameters
    ConferenceId = 1, StartDate='2010-01-28T00:00:00', EndDate='2010-02-03T00:00:00'
    Then it show records
    But When i pass following parameters
    ConferenceId = 1, StartDate='2010-01-27T00:00:00', EndDate='2010-02-03T00:00:00'
    Then it display message No Data Available
    PLease help me on this issue why not FromDate & ToDate range works properly.

    Step1:- First i create a SSAS datasource. Then i create a cube for my table CacheAttendees.
    It has following columns:-
    [Cache Attendees].[Conference Id]
    [Cache Attendees].[Group Date Count]
    [Cache Attendees].[Insert Time Stamp]
    [Cache Attendees].[Screen Name]
    [Cache Attendees].[User Id]
    [Cache Attendees].[User Type Id]
    [Cache Attendees].[User Type Name]
    [Cache Attendees].[Visit Id]
    Step2:- Then i create a dimension with this cube with all columns.
    Step3:- Then i deploy my SSAS project.
    Step4:- Use SSAS datasource in my SSRS datasource.
    Step5:- Create a report with chart control. Add a parameter ConferenceId. Set default to 1. When i preview my report then it show Cache Attendees].[Conference Id].[1] in header of report instead of that, When i pass the parameter value as 1 then report cannot show & throw an error. I want to pass this parameter at runtime.
    Step6:- Please help me how is it possible to pass parameter at runtime.

  • Date range to be displayed  & Displaying multiple values on the report

    Hi,
    I have date range parameters, but I also need it to be displayed it on the report. Is there any way I can display it. E.G If a parameter is created one can drag and drop it on the report if it needs to be displayed on the report, I tried to do the same for the date range parameter but it does not work.
    Also If a parameter is created by selecting the option 'Allow Multiple Values', and if you drag and drop it on the report only the first value is displayed and the rest does not show. Has anyone tried this before and been successful in displaying multiple values in the report.
    Thanks in advance.

    Hi,
    A multi-value parameter is actually treated as an array in Crystal Reports.
    To display the values selected in the parameter, create a formula from the Field Explorer and type this code:
    Join({?ParameterName},",");
    Place this formula on the header or the footer sections of the report.
    Regarding the date range issue, please follow Sastry's advice and it should work fine.
    Make sure you're using the parameter in the Minimum and Maximum functions. For eg: If I was to create a date range parameter called OrderDate, my formula to show the start date would look like this:
    Minimum({?OrderDate})
    -Abhilash

  • Date Range Parameter's Restriction

    Could you someone please tell me how BO restricts date range parameter when the users tries to run a query?  Often times, users simultaneously try to get several years of data dumped into a single query.  Some users even forget to enforce the date range, which causes the query to try to get the data from the beginning of time. 
    How do we as a BO developer create some sort of date range restriction so that it can prevent users from overloading a query?  If the users want to get several years of data, he/she has to run a query in batches instead of doing it all at once.
    I hope there is a way that we can create a custom informational error message for each report to prevent users from trying to query too many months or years of data.  Some reports may hit small and well-indexed tables that allow large date range queries.  But, some reports query against large and poorly indexed tables, which can potentially cause adverse effect on performance without date range restriction. 
    Any thoughts or advices on how to implement such things (if possible).  I am also afraid that the answer will be "currently not doable".  If so, any ideas if the next version of BO will allow such functionality, or if it is at least in the plan at all?  Thank you so much for your insight and sharing.  Have a great day!

    Dear Amr,
    Thanks so much for your quick reply!  The field I want to create a restriction on is called RESULT_DT_TM.  When I saw the "where" section of the field, I just don't see how I can apply my START_DT_TM and END_DT_TM parameters on this field so that START_DT_TM and END_DT_TM cannot be more than 365 days apart.  If my query does not use parameters called START_DT_TM and END_DT_TM, this "where" section will not be valid? 
    I don't think the solution has to be on the field itself but rather on the parameter START_DT_TM and END_DT_TM.  What I want is that as long as START_DT_TM and END_DT_TM are more than 365 days apart, it does not matter what field these parameters are running against. The screen would then display something saying "your date range parameters for this report must be within 365 days.  Please revise your date range on query".
    Sorry, I am PL/SQL report programmer, and not familiar with what BO can do.  So, is there anyway that can make my dream come true?  Thanks a bunch again, Amr.

  • Schedule a report with passing range parameters

    I have wrote a program to run the crystal report in BO server and email to the user. The program can pass the parameter to the crystal report and generate different result/ report. It works well with string parameters, int parameter and date parameter. But when I pass the date range parameters, the CR in BO always displays error "Information is needed before this report can be processed. ", and in the CR history, the Parameters field is "No Parameter"
    For single parameters, I will use the setValue() of IReportParameterSingleValue to set the param value
    IReportParameterSingleValue v = prompt.getCurrentValues().addSingleValue();
    v.setValue(paramValueArray<i>);
    but I dunno how to set the date range value. Anyone ve ideas on this?
    Here is some of my sample code.
    rangeValue.setBeginValue(dateValue1);
    rangeValue.setEndValue(dateValue1);
    rangeValue.getEndValue());
    rangeValue.setLowerBoundType(RangeValueBoundType.inclusive);
    rangeValue.setUpperBoundType(RangeValueBoundType.inclusive);
    newParam.getCurrentValues().add(rangeValue);

    I am not sure if you are using RAS or Enterprise SDK, but here are some code snippets to set range report parameters:
    For scheduling:
    // oReport is IReport object holding the crystal report.
    oReportParameter = oReport.getReportParameters().get(i);
    currentRangeValue = oReportParameter.getCurrentValues().addRangeValue();
    currentRangeValue.getFromValue().setValue(dateParameter);
    currentRangeValue.getToValue().setValue(dateParameter);
    For viewing:
    ParameterFieldRangeValue pfrv = new ParameterFieldRangeValue();
    pfrv.setBeginValue(dateTimeValue);
    pfrv.setEndValue(dateTimeValue1);
    pfrv.setLowerBoundType(RangeValueBoundType.inclusive);
    pfrv.setUpperBoundType(RangeValueBoundType.inclusive);
    pf.getCurrentValues().add(pfrv);
    f.add(pf);
    f is Fields object and pass that to viewer.

  • Date range using "Date Field" from basic component

    Hello Everyone,
    I have been trying to create date range option available on the dashboard based on 2 Date Filed component.
    Backend for this Dashboard is BW with using BEx query. I have a info object (Z_Date)
    Now I want to have 2 date box using Date Field component 1. Start Date 2. End Date.
    I have tried following
    1. Start Date - on Select
    DS_1.setFilter("Z_Date", {"low":StartDate.getDate()});
    2. End Date - on Select
    DS_1.setFilter("Z_Date", {"High":EndDate.getDate()});
    both the scripts do not have any problem but it doest work as it is suppose to be.
    I have also tried based on following How to write script for DATE Range
    But no luck so far.
    Please share if any one have achieved date range working as mentioned.
    Thanks,
    Rajan

    Hi,
    Set Default Date in Both Date Prompts initially .
    1. Start Date - on Select
    var startDate = StartDate.getDate();
    var endDate = EndDate.getDate();
    var varRange = startDate + " - " + endDate;
    DS_1.setFilterExt("Z_SDPCD", varRange);
    2. End Date - on Select 
    var startDate = StartDate.getDate();
    var endDate = EndDate.getDate();
    var varRange = startDate + " - " + endDate;
    DS_1.setFilterExt("Z_SDPCD", varRange);
    Or
    Select Dates First Then Provide a Button (Done) .
    And write code On Click Event of that Button
    var startDate = StartDate.getDate();
    var endDate = EndDate.getDate();
    var varRange = startDate + " - " + endDate;
    DS_1.setFilterExt("Z_SDPCD", varRange);

  • Creating a Parameter with pre-defined date ranges.

    How can I create a parameter that will allow the user to select a specific date range for a report (i.e. YTD, MTD, WTD...)? Any suggestions? Thanks...
    Matt Johnson

    You can create & define Parameters in SSRS Report and provide possible values (MTD, YTD or WTD) as drop-down options, the user can then select which one to pick and you can write your T-SQL logic to capture this option and take further query action
    on it
    Good Luck! Please Mark This As Answer if it solved your issue. Please Vote This As Helpful if it helps to solve your issue

  • How to create a date range in Web Application Designer

    I am using 3.1 version of Web App Designer.  I need to create a report with date ranges.  I can get one date to work but not two (I need a start date and end Date).  My Query has 0CALMONTH with a variable for Interval.  When I select it as a dropdown (??) in Web App Designer, I only get one date prompt in web app designer.
    Any suggestions??
    Thanks
    Kristen

    Hi Kristen,
    I'm sorry i'm not coming to solve your problem,but for the trouble I have had,and I want to create a date picker in Web Application Designer,so if you have solved the problem ,please email to me? [email protected] ,thx very much!
    best regards
    zegion chan

  • Need to create a report to show values for a particular date range

    I have to create a report, out of which I need two columns : << Customer Value Variance and Churn Score Variance >> to show values only for a custom date range, which will be entered via a dashboard prompt.
    These generic date columns are not present and cannot be added. I have to make use of Pres variables
    What I have currently done is:
    1) Created a prompt with 2 different date columns and passing those values into variables vStartDate and vEndDate. (I don't actually need those 2 column which I have selelcted, but I have taken those so that I can prompt the values in calendar format and pass onto the variables)
    2) Created report with necessary columns, with 2 extra columns (hidden) as vStart Date Column and vEnd Date Column which take the values from the presentation variables defined in the prompt. I have created these columns as then I can reference these in the two required columns if necessary.
    I am already facing error in report after doing this and I am confused how to proceed. Any suggestions?
    Thanks.

    Yes, but it only has one generic Date column, no start date and end date. I can't use that twice in the prompt. Although I can specify it to be 'between', but I'm not sure I can pass values to both variables like that.
    Currently I have used Campaign Start Date and Campaign End Date to enter values in calender format to the variables.

  • Creating report based on user selected Date Range

    Hello.
    I am trying to display an Apex report that selects data for the report based on a user entered date range.
    It's a simple page with two date picker fields (p18_start and p18_end).
    The report region SQL looks like this:
    SELECT *
    FROM prj_items
    WHERE LM_DT BETWEEN :p18_start AND :P18_end
    One table, one field on the table to search and two Apex variables.
    I thought this would be fairly simple, but I am obviously missing something.
    I not even sure what other information is needed to help me figure this out.
    -Jody

    Hi,
    You can set defaults for the datepickers if you need to - this could be done in a computation on the page for each item and conditional on the item being null.
    When I've done something similar to this, I've created two hidden page items - eg, :P19_FIRST_DATE and :P19_LAST_DATE and populated these with the earliest/latest date that the user could reasonably select (perhaps, in your case, the MIN(LM_DT) and MAX(LM_DT) values).
    Then your SQL would be:
    select * from PRJ_ITEMS
    where LM_DT BETWEEN TO_DATE(NVL(:P19_START,:P19_FIRST_DATE), 'DD-MON-YY')
    AND TO_DATE(NVL(:P19_END,:P19_LAST_DATE), 'DD-MON-YY')If you don't want to set default dates, you could do something like:
    SELECT * FROM PRJ_ITEMS
    WHERE (:P19_START IS NULL AND :P19_END IS NULL)
    OR (:P19_START IS NOT NULL AND :P19_END IS NULL AND LM_DT >= TO_DATE(:P19_START,'DD-MON-YY'))
    OR (:P19_START IS NULL AND :P19_END IS NOT NULL AND LM_DT <= TO_DATE(:P19_END,'DD-MON-YY'))
    OR (LM_DT BETWEEN TO_DATE(:P19_START,'DD-MON-YY') AND TO_DATE(:P19_END,'DD-MON-YY'))There are various reasons why your two dates are being cleared when the page is reloaded. Firstly, you should check the branch that returns to the same page - make sure you are not clearing the cache for the page. Then, have a look to see if there is a "reset page" process (usually created for you when you create a form page). Then, check the Source settings for the items. Typically, these would be "Only when current value in session state is null" and a Source Type of "Static Assignment" with the "Source Value or Expression" left empty.
    Andy

Maybe you are looking for