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.

Similar Messages

  • Regarding Date Range parameter

    hello,
    in purchase order, i want to pass date range parameter. For eg .
    I want to fetch data from 21/11/2011 to 25/11/2011
    how to pass parameter for this?? or do i need to create any formula??
    if yes then how/???????
    awaiting for soonest reply.

    hi,
    you need to do this in the Formula workshop.
    this formula {OPOR.DocDate} = {?DateRange}
    {OPOR.DocDate} - this is the PO DocDate
    {?DateRange} - this is what you have done in step #4 in my 1st post. in this example "DateRange" is the name of my Parameter.
    Quote from you post
    {OPOR.DocDate} = {?25/11/2011 to 30/11/2011} In this way should i write a formula??????
    change this {?25/11/2011 to 30/11/2011} to the name of your Parameter. refer to step #4.
    regards
    Fidel

  • Pass date range parameter  to SQL stored procedure.

    Hi,
    I'd like to pass a date range parameter from Crystal Reports to a sql stored procedure. Does anyone know if this is possible?
    I've had no problem passing standard datetime (single value) paramaters to and from but am struggling with getting a range value parameter to work.
    Environment: Crystal Reports 10/XI and SQL 2000 MSDE version or SQL 2005 Express Edition.
    Any help would be appreciated.

    C5112736 wrote:>
    > And then these 2 formulas 'Formula # 1' and 'Formula # 2' can be used to pass on to the stored procedure.
    Can someone please demonstrate exactly how to use formula results as date parameters to a SQL stored procedure?  Keep in mind, there are two parameters to the stored procedure.
    I have gleaned this much: Use Add Command and insert the procedure with
    EXEC ServerName.dbo.usp_sprocName;1 '{?StringParameter}'
    but if I try to do
    {CALL ServerName.dbo.usp_SprocName({@Formula1},{@Formula2})}
    then it gives the error "No value given for one or more required parameters". 
    Both of the parameters are VARCHAR(50).
    I have finally found this link: [http://msdn.microsoft.com/en-us/library/ms710248(VS.85).aspx|http://msdn.microsoft.com/en-us/library/ms710248(VS.85).aspx]
    This Microsoft site defines the format of the ODBC escape sequences, but I still do not know how to convince Crystal to insert it's parameter results or formula results.
    Pulling what's left of my hair out . . .
    ~ Shaun

  • CR 2008: Setting currrentdate as default begin date in a date range paramet

    I have a Crystal Report with a date range parameter.
    How do I set the Begin Date to be todays date ?
    I am using a Universe as the data source.
    Thanks,

    Hi Rajesh,
    1) Is the prompt a constant value?
        If yes then type "1900/01/01" in the from value as default value. And in the report selection formula should look similar to this :
    DateVar DateParamValue:-
    If   = Date(1900,1,1)  Then
        DateParamValue := CurrentDate
    Else
        DateParamValue := {?DateParam};
        {Table.DateField} = DateParamValue;

  • Using Date Range parameter in Subreport Selection Formula

    I have a subreport which includes this line in the selection formula:
    {Production.Date} = {?Pm-?DateRange}
    {?Pm-?DateRange} appears in the Subreport Links window, so it seems like it should work.
    The DateRange parameter is set by the user in the Main report.
    But the subreport returns no records.
    I tried this:
    In the Main report I created a StartDate and a StopDate field from {?Pm-?DateRange} .
    Then in the subreport selection formula I used these two formula fields like this:
    {Production.Date} >= @StartDate
    and
    {Production.Date} <= @StopDate
    This works!
    So I have found a workaround, but still, I don't understand why the original code {Production.Date} = {?Pm-?DateRange} returns no records.
    Thanks,
    Art

    Hi Art,
    You cannot use a date range parameter directly in the subreport's record selection formula.
    You'll need to create a formula in the Main report like this:
    Minimum(?DateRange) //This gives the start date
    Maximum(?DateRange) //This gives the end date
    Then send these formulas as parameters to subreport for use in the record selection formula.
    I think you've already got this figured out anyway!
    -Abhilash

  • How would you send a date-range parameter to a SQL sproc?

    Team,
    MY ENVIRONMENT
    SQL 2005, Crystal Reports for Visual Studio 2005
    MY PROBLEM
    I am authoring both a sproc and a report, so I have full control over the design. I am a SQL expert and also a Crystal 8.5 expert.
    I have done the Sproc-Report connection dozens of times.
    Please consider along with me the sequence of creating a report based on a parameterized stored procedure.
    My sproc header is shown here:
    CREATE Procedure dbo.usp_DocumentActivityReport(
         @Department NVARCHAR(50)      
       , @DateRange  NVARCHAR(50)
    ) AS
    SELECT Col1, Col2, Col3 FROM #TEMP
    MY THOUGHT PROCESS
    @DEPARTMENT is a string. That's easy.
    @DATERANGE is a DATE RANGE and I don't know how to get Crystal Reports to prompt for a date range, so I used a String parameter knowing I can parse a specially formatted string, and knowing that I can use a formula to compute the string.
    Step 1. Create the blank report, the {?Department} parameter, the {?CreationDateRange} report parameter, and the {@DateRangeText} conversion formula that converts {?CreationDateRange} to the specially formatted string.
    Step 2. Test the stored procedure.
    Tests pass; It returns data when I run it with values, with zero-length string values, and with NULL values.
    Step 3. Tie the report to the stored procedure.
    Adding the sproc directly creates two hard-wired, undeletable parameters, and returns data columns. That's no good because the user must supply the specially formatted string for the date range. So, I try using Add Command instead, with this syntax:
    {call "EXP_TEST"."dbo"."usp_CorroDocumentActivityReport" (N'{?Department}', N'{@DateRangeText}')}
    This code is accepted, but Add Command did not create any undeletable parameters at all. I guess that's OK.
    But the worst part is that it does not show any output columns with data either! AAARGH!
    Please assist with showing me the proper order to do these steps.
    BTW, here's the VB Syntax formula for {@DateRangeText}:
    Dim min As String
    dim max as String
    if HasLowerBound ({?CreationDateRange}) then
      min = ToText(Minimum({?CreationDateRange}),"MM/dd/yyyy")
    else
      max = ""
    end if
    if HasUpperBound ({?CreationDateRange}) then
      max = ToText(Maximum({?CreationDateRange}),"MM/dd/yyyy")
    else
      max = ""
    end if
    if IncludesLowerBound ({?CreationDateRange}) then
      min = "[" & min
    else
       if HasLowerBound ({?CreationDateRange}) then min = "(" & min
    end if
    if IncludesUpperBound ({?CreationDateRange}) then
        max = max & "]"
    else
       if HasUpperBound ({?CreationDateRange}) then max = max & ")"
    end if
    'formula = min & "..." & max
    formula = "(1/1/2009...3/1/2009)"
    sorry ... cross-posted per Amit

    Ludek,
    It sounds like you and The specified item was not found. think along the same lines! I have cross-posted for both of you now!
    Please see Simple Sproc Parameters question
    ~ Shaun

  • Date Range parameter

    Hello Everyone,
    I want to create a parameter for date range (From , thru) where the user can put the dates he want to to get the information of the project.
    Pls suggest me.
    Suhana

    Thanks Sathish and Abdul,
    But I forgot to mention one thing.
    I have a subrepor with in this report and I want the date parameter to display so that the user can select the dates and get the information in the subreport.
    For this i think i will have to create a parameter in the main report and then link the subreport.
    But my only concern is where to write which formula. In the record selection of main report or the record selection of subreport.
    Thanks a lot
    Edited by: Suhana01 on Apr 26, 2009 10:38 PM

  • Date range parameter in heading

    Post Author: hstevens
    CA Forum: Formula
    Given that I've successfully set up a parameter to prompt for a date range, can I now somehow use that in a heading?  Is there someway to extract the dates from that? Or do I have have to set up two parameters - one for the beginning and one for the end date?
    Thanks.

    Post Author: Jean Antoine
    CA Forum: Formula
    To see all values entered, you would need to read and display every element in the array (multivalue).  Something like this:
    StringVar MVpos;
    NumberVar nMaxLen := UBound(multivalue parameter); // sets the upper limits for the values the user entered
    FOR i:=1 to nMaxLen Do
    If i=1 Then
          MVpos := multivalue parameter&#91;i&#93;
    Else
          MVpos := MVPos ', ' multivalue parameter&#91;i&#93;;
    Here, multivalue parameter represents the parameter you've created.  You can place this formula in your header and see every entery entered.
    Best of luck!

  • 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

  • Disbaling No upper/lower bound value in a date range parameter

    Hi folks,
    When i added a new parameter with a date range , i can see two check boxes 'No lower value' and 'No upper value' along with 'include value' checkbox in the parameter dialog.
    Is there any way to disable these check boxes?? If i cannot disable check boxes and when i select no lower value check box some random date value get returns to the query and the SQL query is giving no results and also i cannot set to a default lower and upper date range too.
    Please help me in resolving this.
    Thanks in advance.

    These features are respective to the range component. If you do not need them, I would suggest that you use two date parameters. One date parameter can act as your low date parameter, and can have it's own default date. The other parameter can act as your high date parameter, and can have it's own default value.
    The only change essentially, in the way the report runs, should be some minor changes to formulas, for example instead of having a selection criteria formula that says in {?DateRange}, you would now say >= {?StartDate} and <=
    Edited by: Kyle McAdam on Aug 15, 2008 6:31 PM

  • Stored Procdure date range problem

    Hi All,
    My Vendor created a Stored procedure which asks for a date range when first creating a standard report. Once the date range is entered then I select which data fields I want to display, etc. Once in the report, I can see the parameter fields, but they have a [?] with a weird little yellow icon, and I cannot see the parameter fields in the parameter tab. My users need to be able to change the date range in InfoView, but since there isn't a date range parameter, they cannot, and I also cannot get it to show up in the report in CR 2008. The only time I can get the date range entered is when creating a report, here is the procedure that the vendor gave me:
    XSAC_GET_TEST_COUNT
                          ( P_REPORT_CURSOR  IN OUT XSAC_REPORTS.TEST_COUNT_VIEW_TYPE,
                            P_START_DATE     IN DATE ,
                            P_END_DATE       IN DATE )
    Not sure how to fix this, and neither does the Vendor, although they created it.
    Any help would be much appreciated.
    I have other reports where I have successfully created a date range parameter, and they work fine, this is my first time with a stored procedure. and it asking for a date range when selecting the data source. Not from a date field in the report

    Hi All,
    I found the problem,
    The first Option is: Show on (Viewer) Panel, it was set to Do Not Show . So it was hidden.
    I changed it Editable and it works fine.
    Hopefully this will help someone in the future.

  • Cascading Pick List with date range as first,  second pick list is dynamic

    Specifically, how is this accomplished?
    It does not seem possible to make first pick list static. If allowed this would be perfect.
    The system seems to only allow the first parameter to be dynamic if the second parameter is dynamic. No range seems to be available for date when second parameter is  dynamic.

    Consider a 3rd-party tool as a solution (for a list of such tools, see http://www.kenhamady.com/bookmarks.html).
    There is at least one Crystal report viewer with its own special implementation of dynamic & cascading parameters.  It would allow you to use any type of parameter within the cascade.  However, you will need to create a separate rpt to implement each dynamic parameter.  So in your case, you will have one main report, using a dynamic parameter that's implemented as a separate rpt, which has a date range parameter. 
    Cheers,
    - ido

  • 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

  • Range Parameter in report heading

    Post Author: Kara
    CA Forum: Formula
    Hi,
    I am using version 9. I have designed a report with a date range parameter that I would like to display in the report header. To get both the 'from' and 'to' dates to appear I am trying to write a formula, but keep getting the message "a string is required". My formula is as follows:
    "from" + Minimum({?Date Range})+ "to" + Maximum({?Date Range})
    Can anyone tell me where I am going wrong?!
    Any help gratefully received.
    received
    Kara

    Post Author: V361
    CA Forum: Formula
    You need two Parameters, name one {?MIN_DateRange} and the other , your customer will be prompted for two dates, Min and Max, then change your formula for the header, replace the + with &  
    "From: "  & {?MIN_DateRange} & "to " & {?MAX_DateRange}

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

Maybe you are looking for