Defaulting Date Parameters

Post Author: tegage
CA Forum: Formula
I have many reports that allow the user to specifiy a starting and ending date range.  I would like the reports to default to all dates.  I can do this by defaulting the start date to "01-01-2000" and the end date to "12-31-2099", but then the calendar tool is useless since there is no TODAY button on the calendar tool and it picks up the default date, i.e., the users will have to do a lot of scrolling through the calendar tool.
The other way is to make the starting and ending date parameters strings and use values like Today, This Week, This Month,....  and reolve them in the record selection formula.   This would be nice, but then if the user wants a specific date range, they don't have the calendar tool to use.
Is there a way to take advange of the user-friendliness of string values and still have the calendar tool to use?

Post Author: tegage
CA Forum: Formula
Thanks much for the response. 
I had done exactly what you described - I had a string parameter for Today, This Week, etc and a set of date parameters - Starting and Ending Date.  But, in order to use the Starting and Ending dates in a formula, I had to provide them a default value - leaving them blank causes the record selection formula to explode.  The issue here is that the calendar tool picks up the default value instead of showing today's date. 
I did more web surfing and found the answer on the Business Objects web site.  The solution let me do what you suggested AND keep the Starting and Ending date parameters as Date types and defaulted to blank by making them optional parameters.
From the Business Objects web site (why isn't this stuff in the user's guide?):
2.  Control over default values.
3.  Request for an 'ALL' value.
Both of requirements 2 and 3 are met with the new optional parameter feature of CR 2008.  When a parameter is flagged as 'optional', the report can execute without that value being set.  The trick here is that any formula that attempts to reference an optional parameters that doesn't have a value set will return an error.  So we've introduced the new HasValue() function which allows you to check and see if the parameter has a value. 
This is really powerful, because now you can reference your parameters indirectly through another formula (or custom function) that checks if the parameter has a value or not.  If it does, then the formula returns the parameter value.  If it doesn't, then it can return whatever default value you wish.  So if you want the default to be the day before, or last Friday, then you can code that logic into your formula that uses HasValue to check if the parameter has a value set or not.
Optional parameters were also intended to solve the 'All' problem.  Basically, you want a parameter to participate in a record selection formula only if it has a value.  If it doesn't, then you want that filter to be disabled.  By using optional parameters and HasValue() in your record selection (and new saved data section) formulas, you can include conditions in your filter only if the parameters in those conditions have a value.

Similar Messages

  • Default date parameters to trunc(sysdate,'IW') in BI Pub Reports 11G

    Hi All,
    I have a requirement to default the date parameters in the BI Pub Report to the following when the reprot is scheduled to run.
    Start Date - Trunc(sysdate,'IW') - 8
    End date - Trunc(sysdate,'IW') - 2
    Steps followed:
    1. I have created 2 Date parameters in the data model as :P_START_DATE and :P_END_DATE.
    2. Created one data set with the query select Trunc(sysdate,'IW') - 8 "P_START_DATE" ,                                 Trunc(sysdate,'IW') - 2   "P_END_DATE
    I have used the same names for the dates so that they are referenced, but its not working as expected.
    Is there any other step i need to follow so that when i run the report from the dashboard, these default values populate which should be editable also.
    Can anyone please help.
    Thanks &Regards
    Geetha

    Hi Neeraj
    Not null parameters are not supported in the current release. All you could do it either default a value in there for the user - check the doc for details. Or drop a msg into the report if that value was null and not return any data. The second is not great I admit :0)
    Tim

  • Default date parameters with timestamps

    Hi everyone!
    I have an user request that I thought should be fairly simple, but I cannot quite get it working.
    We have a concurrent request with beginning and ending date parameters. The users have requested that these dates default to the beginning/end of the current day.
    For example:
    20-MAR-2009 00:00:00
    20-MAR-2009 23:59:59
    I thought this would be a simple sql statement, but Apps does not seem to agree.
    The parameters are of type FND_STANDARD_DATE.
    What we have tried:
    select to_char(sysdate, 'DD-MON-YYYY') || ' 00:00:01' p_beg_date
    , to_char(sysdate, 'DD-MON-YYYY') || ' 23:59:59' p_end_date
    from dual
    -- did not work, said looking for DATE format --
    select to_date(to_char(sysdate, 'DD-MON-YYYY') || ' 00:00:01', 'DD-MON-YYYY HH24:MI:SS') P_BEG_DATE
    , to_date(to_char(sysdate, 'DD-MON-YYYY') || ' 23:59:59', 'DD-MON-YYYY HH24:MI:SS') P_END_DATE
    from dual
    -- works for beg date, but not end date, both display time as 00:00:01 ( I believe i was having issues in TOAD trying to get it as 00:00:00) --
    Any ideas?
    Thanks!
    Janel
    (apologies for the double post - what exactly is the difference between the 2 EBS forums?!?!?)

    Your second code snippet is correct - it works in my instance :-)
    SQL> alter session set NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS';
    Session altered.
    SQL> select to_date(to_char(sysdate, 'DD-MON-YYYY') || '00:00:01', 'DD-MON-YYYY HH24:MI:SS') P_BEG_DATE,
      2  to_date(to_char(sysdate, 'DD-MON-YYYY') || '23:59:59', 'DD-MON-YYYY HH24:MI:SS') P_END_DATE from dual;
    P_BEG_DATE                 P_END_DATE
    20-MAR-2009 00:00:01       20-MAR-2009 23:59:59HTH
    Srini

  • Default date parameters

    Hi everyone!
    I have an user request that I thought should be fairly simple, but I cannot quite get it working.
    We have a concurrent request with beginning and ending date parameters. The users have requested that these dates default to the beginning/end of the current day.
    For example:
    20-MAR-2009 00:00:00
    20-MAR-2009 23:59:59
    I thought this would be a simple sql statement, but Apps does not seem to agree.
    The parameters are of type FND_STANDARD_DATE.
    What we have tried:
    select to_char(sysdate, 'DD-MON-YYYY') || ' 00:00:01' p_beg_date
    , to_char(sysdate, 'DD-MON-YYYY') || ' 23:59:59' p_end_date
    from dual
    -- did not work, said looking for DATE format --
    select to_date(to_char(sysdate, 'DD-MON-YYYY') || ' 00:00:01', 'DD-MON-YYYY HH24:MI:SS') P_BEG_DATE
    , to_date(to_char(sysdate, 'DD-MON-YYYY') || ' 23:59:59', 'DD-MON-YYYY HH24:MI:SS') P_END_DATE
    from dual
    -- works for beg date, but not end date, both display time as 00:00:01 ( I believe i was having issues in TOAD trying to get it as 00:00:00) --
    Any ideas?
    Thanks!
    Janel

    Thank you amox!!
    This gives me 3/20/2009 12:00:24 AM for p_beg_date and 3/20/2009 11:59:36 PM for p_end_date.
    Do you think there is anyway to get the seconds to be 00 for p_beg_date and 59 for p_end_date?
    Also, the concurrent program parameters are actually FND_STANDARD_DATETIME, not FND_STANDARD_DATE as I thought earlier.
    Thanks,
    Janel

  • Default Date Parameters for SSRS Subscription

    I have a SSRS 2008 R2 report running on a Sharepoint 2010 site.
    It has two date parameters (Beginning and Ending Date).
    The defaults of these dates are calculated correctly when running interactively.
    For example:
    =DateAdd("d",-28, Today)
    =DateAdd("d",-1, Today)
    However, when you create a subscription the defaults are based on when the report is submitted and not when the report is executed.
    Is there anyway to set a subscription to pull the default parameters every time when executed.
    Thanks in advance.

    Hi miguelh,
    Based on my research, if we specified the report parameters with “Use Report Default Value” is checked in the subscription, we could get the report from this subscription with the default value. The default values are based on the expression when the subscription
    is executed, rather than the time when we create the subscription. If today is 7/21/2014, the Beginning Date is 6/23/2014, Ending Date is 7/20/2014.
    So, please double check you have typed the expressions as the default values in the two date parameters and we have select the “Use Report Default Value” as the parameter values when creating the subscription .
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Set date Parameters to Default to Current Quarter

    I have 2 date parameters in my report. I would like these parameters to be defaulted to the 1st day of the current quarter and the last day of the current quarter. I need these to be dafaulted because the report is going to be scheduled through BusinessObjects InfoView. I need the flexabilty to allow users to run the report on any date they want, but it needs to default so the scheduling works as expected. Can this be done and if so any assistance would be grateful. Thank you.

    Thomas,
    although you can't set a prompt / parameter to default like this, you can set a record selection to do this...here's how...
    1) in your StartDate and your EndDate parameters set a default value of 1888,08,08
    2) create a new formula called Start with syntax like
    if {?startdate} = date(1888,08,08)
    then
    if month(currentdate) in [1,2,3] then date(year(currentdate),01,01) else
    if month(currentdate) in [4,5,6] then date(year(currentdate),04,01) else
    if month(currentdate) in [7,8,9] then date(year(currentdate),07,01) else
    if month(currentdate) in [10,11,12] then date(year(currentdate),10,01)
    else {?startdate};
    3) create a new formula called End with syntax like
    if {?enddate} = date(1888,08,08)
    then
    if month(currentdate) in [1,2,3] then date(year(currentdate),03,31) else
    if month(currentdate) in [4,5,6] then date(year(currentdate),06,30) else
    if month(currentdate) in [7,8,9] then date(year(currentdate),09,30) else
    if month(currentdate) in [10,11,12] then date(year(currentdate),12,31)
    else {?enddate};
    4) change your record selection formula to something like
    {table.datefield} in {@start} to {@end}
    now if the end user doesn't actually put in custom dates, the record filter will default to the current quarter. if they use custom dates, the those dates will be used.
    of course you will have to edit the above syntax to your parameter names and datefield name. this method will also pass the filter to the database to increase performance.
    cheers,
    jamie

  • How to change the default date in Person assignment tab?

    Hi experts,
    Does anyone know how to change the default date in person assignment tab in cj20n? Currently, the system always take the scheduled finish date to the date of the person assignment tab. Can I change it to the start date?
    Thanks and rgs,
    Michelle

    Hi Michelle,
    Goto SPRO->Project system->Dates->Scheduling->Specify Parameters for Network Scheduling, Here you can control the workforce planning dates.
    Hope this is useful...
    Regards
    Aatish

  • How to restrict  changes in Tabs: Defaults and Parameters in tcode:  SU3

    Good Morning Everybody.
    Do you know how to restrict End Users can change data stored in Tabs Defaults and Parameters of tcode: SU3.
    I was checking Authorization Objects related this transaction but I did not find a way to fix this issue.
    Thanks for your comments.
    Mauricio Cardozo.
    BASIS Consultant.

    I've been looking into this same question.  I don't think there's any way to protect individual user parameters, which is what we really wanted to do, but it is possible to protect the Parameters tab as a whole while still granting access to the Address and Defaults tabs (if desired).  SU3, which is usually given to all users, gives change access to all three tabs in the User Data, but to make it more fine-grained, as the last person said, take away SU3 and instead grant whatever combination of SU0, SU1, or SU2 makes sense for your organization.  SU0 gives access to the Defaults tab, SU1 to the Address tab, and SU2 to the Parameters tab.
    So, in your case, you would grant SU1 only, so users can change their name or phone number, etc, but not Defaults or Parameters.  They won't even be able to see defaults or parameters if you do this, though.
    I hope this helps.
    --Matt

  • Date Parameters

    Hi,
    Please see my query below,
    I'm having a bit of trouble with my date parameters.
    If $P{from_date} = 01-Jan-2010
    and $P{to_date} = 02-Jan-2010
    Is there a reason why i'm not getting any data for 02-Jan-2010?
    It's probably something simple that i'm missing.
    select
    count(tag_id),
    itl.sku_id,
    itl.client_id,
    itl.reference_id,
    sum(itl.update_qty),
    to_char(trunc(itl.dstamp), 'DD-Mon-YYYY') rec_date,
    to_char(sysdate, 'DD-Mon-YYYY | HH24:MI:SS') as systemdate,
    to_char(trunc(itl.expiry_dstamp), 'DD-Mon-YYYY') exp_date,
    s.ship_shelf_life as sku_shelf_life,
    s.ship_shelf_life + 2 as plus_shelf_life,
    (trunc(itl.expiry_dstamp) - (s.ship_shelf_life + 2)) - trunc(sysdate) as plus_days_left,
    (trunc(itl.expiry_dstamp) - (s.ship_shelf_life + 2)) - trunc(itl.dstamp) as plus_days_left_when_rec,
    (trunc(itl.expiry_dstamp) - trunc(itl.dstamp)) as clear_days
    from inventory_transaction itl, sku s
    where s.sku_id = itl.sku_id
    and ($P{from_date} is null or ($P{from_date} is not null and itl.dstamp >= to_date($P{from_date}, 'DD-Mon-YYYY')))
    and ($P{to_date} is null or ($P{to_date} is not null and itl.dstamp <= to_date($P{to_date}, 'DD-Mon-YYYY')))
    and itl.code = 'Receipt'
    group by itl.sku_id, itl.client_id, to_char(trunc(itl.expiry_dstamp), 'DD-Mon-YYYY'), to_char(trunc(itl.dstamp), 'DD-Mon-YYYY'),
    itl.reference_id, s.ship_shelf_life, s.ship_shelf_life + 2, (trunc(itl.expiry_dstamp) - (s.ship_shelf_life + 2)) - trunc(sysdate),
    (trunc(itl.expiry_dstamp) - (s.ship_shelf_life + 2)) - trunc(itl.dstamp), (trunc(itl.expiry_dstamp) - trunc(itl.dstamp))
    order by itl.client_id, itl.sku_idThanks in advance,
    SM.

    Sam Mardell wrote:
    Is there a reason why i'm not getting any data for 02-Jan-2010?Yes :) Every date has an hours, minutes and seconds component. When you apply the TO_DATE() function on a character string that just contains month, day, and year the time component defaults to midnight (00:00:00). There are multiple methods to get around this:
    < to_date($P{to_date}, 'DD-Mon-YYYY') + 1
    <= to_date($P{to_date} || '23:59:59', 'DD-Mon-YYYY HH24:MI:SS')
    <= to_date($P{to_date}, 'DD-Mon-YYYY') + (60*60*24 - 1)Above are just examples, there are many more ways to achieve this.
    HTH!

  • Error when using Date Parameters...

    Hi everybody,
    I have a little issue.
    Ever since I upgraded my CRXI R2 to SP4 I've had a little problem using date parameters.
    The little calendar icon next to the parameter field no longer works.
    When I click it I get the following error message:
    An error has occurred in the script on this page.
    Line:       79
    Char:      1
    Error:      Object Expected
    Code:      0
    URL:       file://C:\Documents and Settings\jlong\Local Settings\Temp\prompting1.html
    I'm thinking this is probable a quick registry fix, but I have no idea where to start looking.
    Hopefully one of you CR guru's knows the answer.
    Thanks in advance,
    Jason

    It seems you are having a scripting issue.
    Go onto the Internet explorer settings (internet options under control panel)
    click on security and then click on Internet and then Custom tab.
    Scroll right down where it says Scripting and enable it.
    That should resolve the issue.
    Here is the full list of browsers with scripting options:
    Windows Internet Explorer
    (all versions except Pocket Internet Explorer)
    Note To allow scripting on this Web site only, and to leave scripting disabled in the Internet zone, add this Web site to the Trusted sites zone.
    1. On the Tools menu, click Internet Options, and then click the Security tab
    2. Click the Internet zone.
    3. If you do not have to customize your Internet security settings, click Default Level. Then do step 4
    If you have to customize your Internet security settings, follow these steps:
    a. Click Custom Level
    b. In the Security Settings u2013 Internet Zone dialog box, click Enable for Active Scripting in the Scripting section.
    4. Click the Back button to return to the previous page, and then click the Refresh button to run scripts.
    ===========
    Mozilla Corporationu2019s Firefox version 2
    1. On the Tools menu, click Options.
    2. On the Content tab, click to select the Enable JavaScript check box.
    3. Click the Go back one page button to return to the previous page, and then click the Reload current page button to run scripts.
    ===========
    Opera Softwareu2019s Opera version 9
    1. On the Tools menu, click Preferences.
    2. On the Advanced tab, click Content.
    3. Click to select the Enable JavaScript check box, and then click OK.
    4. Click the Back button to return to the previous page, and then click the Reload button to run scripts.
    ===========
    Netscape browsers
    1. Select Edit, Preferences,Advanced
    2. Click to select Enable JavaScript option
    Hope this helps.
    Regards
    Jehanzeb
    Edited by: Jehanzeb Navid on Jul 28, 2008 4:38 PM
    Ok I think I got this totally wrong. this isn't what you are looking for.
    Sorry!!! can't delete this reply arggghh!!!
    Edited by: Jehanzeb Navid on Jul 28, 2008 4:40 PM
    Maybe this might help?
    Remove Web Customization
    If multiple folders are causing the script error, remove Web customization from any folder that generates the error message.
    To remove customization from a folder, use the following steps:
    1. Open the appropriate folder.
    2. On the View menu, click Customize This Folder, click Remove Customization, click Next, and then click Finish.
    3. Close the folder.

  • Using date parameters entered by user within Chart

    I would like to allow the end user to populate a start date and end date which will be used to generate a Pie Chart. I have been following posting How to Create a Chart from a user's date range input ? and I'm having problems.
    I have created two Page Items to allow the user to enter a date range. Both Page Items are set to Date Picker ('DD-MON-RR') The start date has a default value set to the first day of the year by using round(SYSDATE, 'YYYY') The end date defaults to SYSDATE.
    The flash chart series is defined as the following:
    select null link, trunc((months_between(sysdate, c.DATE_OF_BIRTH))/12) label, count(*) value1
    from FAMILY_INTAKE f
    , CLIENT c
    where f.client_id = c.client_id
    AND f.intake_date between nvl(:P19_START_DATE, f.intake_date) AND nvl(:P19_END_DATE, f.intake_date)
    group by trunc((months_between(sysdate, c.DATE_OF_BIRTH))/12)
    When I run the page, the pie chart works; however, it does not seem to use the values used in the date parameters. It seems to be using the null value of f.intake_date. No matter what I set the date parameters to, the results are always the same.
    Any help would be appreciated... Thanks!
    Pam

    How does one operate the page? Select one or two date values and press Go, or something? Then the page branches back to itself? If so, are the date items showing the selected values or getting reset?
    Scott

  • BAM : Date parameters

    Hi , We have a report level paramters : start date and end date.
    These two parameters we would like to default to sysdate-1 and sysdate.
    start date should default to sysdate-1
    end date should default to sysdate
    How do we achieve this ?
    Thanks,
    Satish

    Thanks for your reply, but it didn't satisfy my requirement.
    Here is the detail requirement.
    1. I have 4 views on a single dashboard
    2. I have two date parameters (Start Date and End Date) (dashboard level) . Once I select these dates , it will refresh all the 4 views that are there on the dashboard.
    3. To implement point 2 above , I added filters to all the 4 views pointing to the report level parameters(Report Start time and End time).
    4. Now I want these two report level parameters to be defaulted to sysdate and sysdate -1 so that first time when dashboard opens, it apply these default conditions. after the report opens, User should be able enter his own date range and it needs to reflect in the report.
    Please suggest how to implement the above.
    In addition to above , How would I build filters with (all OR conditions, AND and OR conditions) ? Whats the use of (add new header) in the filters tab ? Is this helps in building AND OR conditions in the report ?
    Thanks,
    Satish

  • Optional Date parameters in SQL Command

    I'm using Crystal Reports 2008. I want to make the start and end date parameters optional and have them default to the beginning and end of the previous month. Unfortunately, I'm using an SQL Command, rather than filtering in the Record Selection Formula, and I can't see any way to pass the computed start and end dates into the query. Is there any way to get the results I want short of omitting the date parameter in the query and doing all the filtering on the front end? Thanks.

    The way I have gotten around this problem is to make the date parameters strings, and allow mnemonics such as PM for prior month, PD for prior day, PQ for prior quarter, etc.  I then wrote Crystal and database functions that convert these mnemonics to actual dates, which are then used where necessary.  This is also useful for scheduling the same report to run weekly (for the prior week), monthly (for the prior month) and quarterly (for the prior quarter)...
    Also, remember that an SQL command in Crystal is basically the equivalent of a stored procedure, so you can do a lot of logic in them before returning your data set.  So, in your SQL, you could set a variable to either the parameter value or a calculated prior month dependent on if the date parameter is null (assuming Crystal allows no entry for the parameter, which I think 2008 does [I'm on XI R2]).
    HTH,
    Carl

  • How to have date parameters nullable in fetch xml crm report

    Hi All ;
    Below is my report parameter query
    <fetch distinct="true" mapping="logical">Date.getTime()
    <entity name="new_programmeoutput">
    CrmDateTime @Search = new CrmDateTime { Value = String.Format("{0:MM/dd/yyyy}", DateTime.Now) };
    CrmDateTime @Search1 = new CrmDateTime { Value = String.Format("{0:MM/dd/yyyy}", DateTime.Now) };
    <attribute name="new_claimdate" />
    <filter type ="and">
    <condition attribute="new_claimdate" operator="ge" value="@Search" />
    <condition attribute="new_claimdate" operator="lt" value="@Search1" />
    </filter>
    <order attribute="new_claimdate" />
    </entity>
    </fetch>
    which works fine if the start date and the end date is entered
    but if the start date and end date is made null ... it doesn't display any values
    In fact if these ( start date and end date)parameters are made null i need to display all the values in the report irrespective of the date parameters
    Any help much appreciated
    Thanks
    Pradnya07

    Unfortunately, not works :(
    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
    <entity name="activitypointer">
    CrmDateTime @dFrom = new CrmDateTime { Value = String.Format("{0:dd.MM.yy}", DateTime.Now) };
    CrmDateTime @dTo = new CrmDateTime { Value = String.Format("{0:dd.MM.yy}", DateTime.Now) };
    <attribute name="activitytypecode" />
    <attribute name="subject" />
    <attribute name="statecode" />
    <attribute name="prioritycode" />
    <attribute name="modifiedon" />
    <attribute name="activityid" />
    <attribute name="instancetypecode" />
    <attribute name="community" />
    <attribute name="regardingobjectid" />
    <attribute name="stageid" />
    <attribute name="ownerid" />
    <attribute name="modifiedby" />
    <attribute name="createdon" />
    <attribute name="actualstart" />
    <attribute name="actualend" />
    <attribute name="actualdurationminutes" />
    <order attribute="modifiedby" descending="false" />
    <order attribute="modifiedon" descending="false" />
    <order attribute="activitytypecode" descending="false" />
    <filter type="and">
    <condition attribute="modifiedon" operator="on-or-after" value="@dFrom" />
    <condition attribute="modifiedon" operator="on-or-before" value="@dTo" />
    </filter>
    </entity>
    </fetch>
    when run report, receive error:
    The date-time format for 22.01.2015 0:00:00 is invalid, or value is outside the supported range.
    Default values are correct (=22.01.15).
    No any limitations on values

  • Default data for article master -Purchasing/Logistics view

    Hello,
    What is the difference between below configuration settings:
    1. Logistics general --> Basic data retail --> General control, retail master data --> tab Control parameters for article master --> field 'vendor default data'
    2. Logistics general --> Business Partner --> Vendor --> controls --> Define account groups --> go to details --> tab default values
    Are these settings intended for same purpose ( e.g. copy default data from vendor master to article master) ?
    Thanks,
    Pat.

    Found the answer
    Copying of Data from the Vendor Master to Purchasing Data
    All changes that you make to the reference data in the vendor master record are copied to the purchasing data in the article master record if the system is configured accordingly in Customizing for Business Partners in Define Account Groups and Field Selection for Vendors.
    Copying of Data from the Vendor Master to Logistics Data
    The changes are also copied to the site-specific logistics data if the vendor is either the sole vendor or the regular vendor and if the system is configured accordingly in Customizing for Logistics Basic Data: Retail in General Control, Retail Master Data. For more information, see Vendors: Copying Changes to Other Data Records.

Maybe you are looking for