Controling Date Parameters using SRW.DO_SQL in Reports!

Hello Friends,
I Need to Control the Date Parameters in Reports.
(Dev/2000 rel2.1) In SRW.Do_SQL package
For Example:
'Insert into x
select * from Y
where Y.date between f_date and t_date';
Here: X,Y are two tables
f_date and t_date are two different date parameters in
format (dd-mm-yyyy).
NOTE: Without these two date parameters, the Query is working
fine. But I need to Use these Parameters. Could You Please find a
solution for Me. Thanks in advance.
Regards
Manoj (India)
(Dt:18thNov'99)
null

Manoj (guest) wrote:
: Hello Friends,
: I Need to Control the Date Parameters in Reports.
: (Dev/2000 rel2.1) In SRW.Do_SQL package
: For Example:
: 'Insert into x
: select * from Y
: where Y.date between f_date and t_date';
: Here: X,Y are two tables
: f_date and t_date are two different date parameters
in
: format (dd-mm-yyyy).
: NOTE: Without these two date parameters, the Query is working
: fine. But I need to Use these Parameters. Could You Please
find a
: solution for Me. Thanks in advance.
: Regards
: Manoj (India)
: (Dt:18thNov'99)
Hi Manoj
your goal is to supply all three as dates (y.date, f_date,
t_date). if some of them are not date but char, varchar, ...
then use to_date conversion function with proper format mask.
hope this helps.
null

Similar Messages

  • Date parameters using MDX query

    Hello experts,
    Not sure if this question falls under SSAS or SSRS but I'm writing it here for now and hopefully get the answer.
    I'm using SSAS cube to develop a report using SSRS and this is the first time I'm doing it. I want to filter records based on date range and did some research online. My report contains two datasets:
    1. dsMain dataset -> it contains all the field which I want to use in the report and added a parameter thru query designed with following settings:
    Dimension : Dates
    Hierachary : Date
    Operator : Range (Inclusive)
    Parameters : checked
    it created two parameters called FromDatesDate and toDatesDate
    2. I created another dataset called dsDate and wrote a custom query (found at following link) and changed FromDatesDate and ToDatesDate using this date dataset
    https://jsimonbi.wordpress.com/2011/03/22/using-a-date-parameter-in-ssrs-with-mdx/
    Query for dsDate
    WITH
    MEMBER DateValue
    AS
       [Dates].[Date].CurrentMember.UniqueName
    MEMBER DateLabel
    AS
       [Dates].[Date].CurrentMember.Name
    SELECT
        [Measures].[DateValue],
        [Measures].[DateLabel]
    } ON 0,
         [Dates].[Date].[Date]
    } ON 1
    FROM [myCube]
    Here is the value returned by dsDate dataset (above query)
                            DateValue                          DateLabel
    06/04/1980 [Dates].[Date].&[29375]
    06/04/1980
    06/05/1980 [Dates].[Date].&[29376]
    06/05/1980
    06/06/1980 [Dates].[Date].&[29377]
    06/06/1980
    06/07/1980 [Dates].[Date].&[29378]
    06/07/1980
    06/08/1980 [Dates].[Date].&[29379]
    06/08/1980
    06/09/1980 [Dates].[Date].&[29380]
    06/09/1980
    06/10/1980 [Dates].[Date].&[29381]
    06/10/1980
    06/11/1980 [Dates].[Date].&[29382]
    06/11/1980
    06/12/1980 [Dates].[Date].&[29383]
    06/12/1980
    06/13/1980 [Dates].[Date].&[29384]
    06/13/1980
    Here is what I changed in FromDatesDate and ToDatesDate parmeter:
    Under Available Values tab:
    Dataset : dsDate
    Value Field : DateValue
    Label Field : DateLabel
    Here are my questions:
    1. I want to use date/time parameter so that user doesn't have to scroll thru whole date dimension.
    2. I changed the FromDatesDate and ToDatesDate to date/time parameter, removed the values from Available values tab and made the following changes on Parmaeters expression under dsMain dataset
    =”[Dates].[Date].&[” + Format(CDate(Parameters!FromDatesDate.Value),”MM/dd/yyyy”)
    + “T00:00:00]”
    =”[Dates].[Date].&[” + Format(CDate(Parameters!ToDatesDate.Value),”MM/dd/yyyy”)
    + “T00:00:00]”
    Now when I run the report I get following error:
    Query (1, 55) The restrictions imposed by the CONSTRAINED flag in the STRTOMEMBER function are violated.
    I think the reason is by changing parameter to date/time, now I cannot get "DateValue" which is required for the query.
    1. What is the best way to work with date parameters?
    Hope it is all clear and look forward to hear from experts.
    Thanks,
    P
    mark it as answer if it answered your question :)

    Hi Parry2k,
    In Analysis Services, a member can be referenced by either its member name or by its member key. The member key is used by the dimension to specifically identify a given member. The ampersand (&) character is used in MDX to differentiate
    a member key from a member name. In this scenario, the datetime is member name, not the member key. So you should not add "&".
    Reference:
    Member Names and Keys
    Simon Hou
    TechNet Community Support

  • How to access data without using authorization variable in report?

    Hello All,
    I am using two varibles in report, without using exit varible in report how to get the data based values enter in the ohter variable.
    How to find the roles and display the data " with out using the concept called varible used in report"

    Sorry..for late response.
    Answers to your questions:-
    Previous day to current date.
    I tried to follow steps given in the following link but failed as we have Teradata as data source and I dont know how to write a syntax for teradata similar to what is explained by Dave.
    http://www.dagira.com/2007/08/22/dynamic-dates-part-i-yesterday-and-today/
    Regards

  • Using srw.run_report in report server

    Dear all,
    I'm running a report (report A) on the report server and after it is running (printing output on screen), I need to run report B at the background and save the output of report B to the file system. In the report A's After Report Trigger, I have a srw.run_report function, the syntax is: srw.run_report('server='||v_serverName||' report='||v_reportName||' batch=yes destype=file desname=/tmp/output.pdf desformat=pdf p_startdate=''12-JUN-2003'' p_enddate=''14-JUN-2003'''). When I run the above syntax (without the server name part) in report builder, it works fine. But I couldn't get it working on the report server. Each time report A runs, report B couldn't be run at all (no job id was given or scheduled). Could anyone give me an idea on whether srw.run_report could be used in the report server?
    Many thanks for your urgent help.
    Rose

    Can I use this build it to run itself? I mean in your case run report A?
    our report is launched from servelet. because of some security issues, I would like to use this built in to change it to command line after user enter all the parameters through the parameter form.
    thanks.

  • 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

  • Report6i is getting hanged when i am using truncate command in srw.do_sql

    Hi All,
    I am using Reports 6.0.8.18.0 and oracle 9.2.0.1 on Windows XP with SP1.
    I am having a report in which i have used "truncate table <tablename>" command using SRW.do_sql command. some times report is getting hanged and some times it is giving an error as given below
    18:26:52 ERR REP-1425: 'afterpform': Error running DO_SQL package - 'Error parsing the SQL statement.
    ORA-04021: timeout occurred while waiting to lock object <object name >
    When i checked with the Oracle 8.1.7 database it is working fine.
    is there any patches are requried at database side ?
    Can any body help me in this.
    Regards,
    Gouri

    First: you should get a new keyboard. Seems your shift-key is stuck.
    Second: A header of a post is a header and not for a summary of your question
    Third: This is the forum for the tool SQL Developer. Please mark this question as answered and post again in Forms
    Forth: When you expect an answer, the least would be to include the errormessage and your forms version.
    Regards
    Marcus

  • SRW.DO_SQL PROBLEM

    Hi All,
    Can i use SRW.DO_SQL package like this :
    SRW.DO_SQL('@xyz.sql')
    if 'YES' then where shell i keep the sql file ? i mean in orant\bin directory or in the directory where my report file exists.
    And if 'No' then how can i run a batch file in my report ?
    TIA
    Manish

    hello,
    srw.do_sql ( sql_stmt varchar2 )
    so it only takes a string as parameter not a filename.
    regards,
    the oracle reports team

  • How to use nvl to parameter in SRW.DO_SQL  in oracle report

    Hi all,
    I am creating view runtime where i want to pass parameter to which i need to handle NVL
    below is my code
    SRW.DO_SQL('create view '||view_name11||' as
    select moqv.subinventory_code subinv,
    moqv.inventory_item_id item_id,
    moqv.item_cost item_cost,
    0 source_type1,
    0 source_type2,
    0 source_type3,
    0 source_type4,
    0 source_type5,
    0 other,
    --decode('||selection||',1,sum(transaction_quantity),sum(transaction_quantity * NVL(moqv.item_cost,0)))                           cur_qty_val,
    sum(transaction_quantity) cur_qty,
    sum(transaction_quantity) target_qty,
    moqv.organization_id
    from mtl_onhand_qty_cost_v moqv
    where moqv.organization_id = ''nvl'||'('||var_org||','||'moqv.organization_id'||')''
    group by moqv.subinventory_code, moqv.inventory_item_id, moqv.item_cost' );
    thanks in advance

    And your problem is?
    I see a lot of quotes, so I guess that is your problem. Just fix it with the right amount of quotes.

  • Compare Date Parameters on Report Viewer

    Visual Studio 2010 (VB.NET)
    Crystal Reports 2010
    I have two date parameters in my report viewer (Start and End dates). When the user clicks the "Apply" button in the parameter panel is there any way to display a dialog box if the Start date is after the End date?
    I don't see any event for the "Apply" button, just the "Refresh" button (the ReportRefresh event).

    I actually got a hack job workaround to get this to work without having to write my own parameter panel or edit any of my 150+ reports:
    At the form load I can loop through the controls in the crystal viewer until I find the toolbar that holds the "Apply" button and add an event handler to it's ButtonClick event.
    I am using VB.NET:
    'Because there is no event handler for the "Apply" button in the parameter panel,
    'loop through the controls until we find the toolbar that holds that button. We can then
    'add an event handler to the button click event so we can check if the "Apply" button is clicked.
    For Each ctl As Control In CurrentCrystalReportViewer.Controls
        If ctl.Name = "InteractiveParameterPanel" Then
            'This control is the parameter panel
            For Each subCtl As Control In ctl.Controls
                If TypeOf subCtl Is Windows.Forms.ToolBar Then
                    'This controls is the toolbar that holds the "Apply" and "Delete" parameter buttons
                    Dim parmTool As ToolBar = subCtl
                    'add event handle so we can catch when a button is clicked
                    AddHandler parmTool.ButtonClick, AddressOf ParmToolBar_ButtonClick
                    Exit For
                End If
            Next
        End If
    Next
    When the "Apply" button is clicked this event will then be called:
    Private Sub ParmToolBar_ButtonClick(ByVal sender As Object, ByVal e As ToolBarButtonClickEventArgs)
            If e.Button.Text = "Apply" Then
                'check if there are date parameters
                If CurrentCrystalReportViewer.ParameterFieldInfo.Count > 0 Then
                      'loop through and find the start and end date parameters to compare the dates.
                End If
            End If
    End Sub

  • Date Parameters in Report

    Hello,
    I am using the Where property of an Open Report for date parameters.  There are reason i can not use the query criteria process.
    Can I do this with more than one parameter?
    Private Sub EligibilityReportPreview_Click()DoCmd.OpenReport "EligibilityRpt2",acViewPreview,,"effective_date >= LowEffectiveDate And effective_date <= HighEffectiveDate"End Sub
    How do add another parameter like
    DoCmd.OpenReport "EligibilityRpt2", acViewPreview, , "effective_date >= LowEffectiveDate And effective_date <= HighEffectiveDate"
    Or "termination_date >= LowTerminationDate And termination_date <= HighTerminationDate"
    Gee

    If all names referred to are fields in the record source of the report, you can use
    DoCmd.OpenReport "EligibilityRpt2", acViewPreview, , "effective_date >= LowEffectiveDate And effective_date <= HighEffectiveDate Or termination_date >= LowTerminationDate And termination_date <= HighTerminationDate"
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Date parameter does not work in SharePoint 2010 report using SQL 2008 Server Reporting Service

    Here is the settings:
    SharePoint 2010 with SQL server 2008 reporting services configured
    When create a report for a SP list using SQL server report builder (3.0) the date parameter does not work.
    The data parameter is set as "date and time" type and field name equals the col name in the SP list
    When run the report, the whatever dates I select, the result is always the same, so the parameters do not take any effect.
    Is any step missing?
    Thanks for any advice !

    Hi ,
    How did you configure you "date and time" type parameter and field name equals the col name in the SP list?
    Have you tested if other type parameter worked?
    Have you tried typing the date format as 20140722 in your date parameter filed before run the report?
    http://whitepages.unlimitedviz.com/2012/02/using-sharepoint-filters-with-reporting-services-parameters-for-personalized-reports/
    Thanks,
    Daniel Yang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Daniel Yang
    TechNet Community Support

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

  • How to use Count with Date Parameters

    Hello,
    I am having issues using the Count() function in conjunction with date parameters.
    This is a Siebel report and in my report I have 2 date parameters(From Date, To Date). In a nutshell I am basically trying to count Opportunities that has a start date within the given date period. However I don't see a reasonable way to put my date parameters within the Count() function. The reason being is that I need to have a huge chunk of code to convert the dates into a common format that can be compared, and it won't even fit within the code block in my rtf template. I am not even sure how to put multiple conditional statements inside a Count() function since all the examples I have seen are very simple.
    Anyone have a suggestion on how to use Count() with date parameters?
    Thanks.

    Any chance you can get the date formats in the correct format from siebel?
    I don't know Siebel - so I can't help you with that. If you get the correct format it is just
    <?count(row[(FromDate>=date) and  (date<=ToDate))?>
    Otherwise the approach would probably need to use string function to get year/monthd/day from the date
    and store it into a varialbe and compare later the same way
    <?variable@incontext:from; ....?>
    <?variable@incontext:to; ...?>
    <?count(row[($from>=date) and  (date<=$to))?>
    Potentially you can use the date functions such as xdofx:to_date to do the conversion
    [http://download.oracle.com/docs/cd/E12844_01/doc/bip.1013/e12187/T421739T481158.htm]
    But I am not sure if they are available in your siebel implementation.
    Hope that helps

  • Passing 2 date parameters in report

    I have to create a report in such a way that ...i have to pass 2 date parameters to get the report..
    For example..
    I get report parameter pagein reports and then I enter the parameter
    Parameter1: 27-MAY-10
    Parameter2: 30_JUN-10
    and then i click RUN REPORT
    can any1 help me out how to pass this parameter in report... i am stuck at this point
    NOTE: I want to use the parameter form feature in report builder....

    @ Sarah
    what you do is to call a refort from a form. i think it is not what Suhail want.
    @ Suhail
    if i understand, you want to pass the parameters from the parameterform your report to the report.
    i think you must create a parameterform and save it als html like this:
    To create a simple Parameter Form in HTML:
    1. In a text editor or HTML editor, create an HTML page that contains a form. The
    form should contain a list of values, a field, and a button. The code for this form
    can look something like the following:
    <form name="form1" method="post" action="*NAME_form.jsp*">
    <h2>Parameter Form</h2>
    <input id="connect" type="hidden" name="userid" value="*hr/hr@db-connect*">
    <input type="hidden" name="destype" value="*cache*">
    <input type="hidden" name="desformat" value="*html*">
    <br> Date_beginn: <input type="text" name="Date Beginn" value="">
    <br> Date_end: <input type="text" name="Date end" value="">
    <input type="submit" name="Submit" value="Run Report">
    </form>
    you can save this code als .html.
    Now you can open the code in the report builder and save it als .jsp.
    you can yet start with the copilation of the report.
    i hope this code will help you.

  • SSRS 2012 SP2, Native / Report Manager, non-IE browsers show date parameters in US format MM/DD/YYYY, ignoring locale settings

    I have a server running SSRS 2012 SP2, in Native / Report Manager mode. The server, reports, desktop etc are all set to en-AU.
    Using IE, date parameters show as expected in DD/MM/YYYY format.  However using Chrome or Firefox, they show in US format MM/DD/YYYY.
    Does anyone know how to fix this?

    Hi Jiri,
    Thanks for that speedy tip - that has solved it for Chrome.
    I followed a similar path to get it fixed for Firefox - Settings / Content / Languages / add English/Australia [en-au] / Move Up to top spot.
    Mike

Maybe you are looking for

  • Need to update a record on page load. How? (ASP/VBScript)

    The standard Update Record behavior requires a form on the page, plus a recordset to identify the value to be updated. In my scenario, the value for the record to be updated is already in the URL as the ID. I just don't know how to write it myself an

  • Saving a PDF using Mac OS X Lion 10.7

    How can I restore the save as feature when I open a pdf?  I am using lion 10.7 on a macbook pro.

  • Share With Individuals

    I ran into a bit of confusion with the Share It With Individuals option.  I shared two files with two persons selecting the Share It With Individuals which I understood to mean that only those persons would be able to open.  When I looked at the info

  • Ojc bug compiling simple java class

    Hi, I am trying to compile some very old Java code with JDeveloper 10.1.2.1.0 (Build 1913) and running into a very strange problem. I cannot use the "import" statement to import classes, which are stored in root without a package name specification.

  • Content of a vCard used by an iPod

    Hi all folks, does someone know the vCard (.vcf) file entries/attributes/values content are supported by an iPod (Nano, Classic). FN is used in the Contact List, N, ADR, TEL, EMAIL, NOTE are used in the Contact Card, ORG is not used, CATEGORIES is us