How to get result from query for ssrs?

DECLARE @meter_number int
SET @meter_number=25112
IF @meter_number IN (SELECT meter_number FROM ods.pmc.meter_registers)
BEGIN
SELECT 'LA' as [data_center]
, t.request_time_gmt
, aca.transaction_id
, aca.meter_number
, CONVERT(date, aca.ship_date_gmt) as ship_date
, aca.user_name
, p.confirmation_number
, p.origin_zip
, p.destination_zip
, p.destination_zip_addon
, p.base_postage_cost
, p.mail_class_id
, p.weight_ounces
, p.delivery_confirmation
, cil.ascending_register
-- , ih.transaction_date_gmt
, ih.from_name, ih.from_company, ih.from_address_line_1, ih.from_address_line_2, ih.from_city, ih.from_state, ih.from_zip
, ih.to_name, ih.to_company, ih.to_address_line_1, ih.to_address_line_2, ih.to_city, ih.to_state, ih.to_zip
FROM ods.sws.create_indicium_log aca --#USPS_Amazon_Cust_Activity aca
JOIN ods.sws.prints p (NOLOCK)
ON aca.transaction_id = p.transaction_id
JOIN ods.sws.transactions t (NOLOCK)
ON aca.transaction_id = t.transaction_id
JOIN ods.sws.create_indicium_log cil (NOLOCK)
ON aca.log_id = cil.log_id
LEFT JOIN ods.pmc.indicium_history ih
ON p.confirmation_number = ih.confirmation_number
END
ELSE IF @meter_number in (SELECT meter_number FROM ods.pmc_dr01.meter_registers)
BEGIN
SELECT 'PHX' as [data_center]
, t.request_time_gmt
, aca.transaction_id
, aca.meter_number
, CONVERT(date, aca.ship_date_gmt) as ship_date
, aca.user_name
, p.confirmation_number
, p.origin_zip
, p.destination_zip
, p.destination_zip_addon
, p.base_postage_cost
, p.mail_class_id
, p.weight_ounces
, p.delivery_confirmation
, cil.ascending_register
, ih.from_name, ih.from_company, ih.from_address_line_1, ih.from_address_line_2, ih.from_city, ih.from_state, ih.from_zip
, ih.to_name, ih.to_company, ih.to_address_line_1, ih.to_address_line_2, ih.to_city, ih.to_state, ih.to_zip
FROM ods.sws.create_indicium_log aca--#USPS_Amazon_Cust_Activity aca
JOIN ods.sws_dr01.prints p (NOLOCK)
ON aca.transaction_id = p.transaction_id
JOIN ods.sws_dr01.transactions t (NOLOCK)
ON aca.transaction_id = t.transaction_id
JOIN ods.sws_dr01.create_indicium_log cil (NOLOCK)
ON aca.log_id = cil.log_id
LEFT JOIN ods.pmc_dr01.indicium_history ih
ON p.confirmation_number = ih.confirmation_number
END
I executed this query it says command completed successfully how can it return results?

Hi,
Create a procedure as shown below in the database and while creating the Dataset in SSRS , Select Stored procedure as a source and call this newly created procedure using command EXEC Usp_Meter_Number 25112.
The columns will automatically generated and u can use the columns.
CREATE PROCEDURE Usp_Meter_Number
@meter_number int
AS
BEGIN
IF @meter_number IN (SELECT meter_number FROM ods.pmc.meter_registers)
BEGIN
SELECT 'LA' as [data_center]
, t.request_time_gmt
, aca.transaction_id
, aca.meter_number
, CONVERT(date, aca.ship_date_gmt) as ship_date
, aca.user_name
, p.confirmation_number
, p.origin_zip
, p.destination_zip
, p.destination_zip_addon
, p.base_postage_cost
, p.mail_class_id
, p.weight_ounces
, p.delivery_confirmation
, cil.ascending_register
-- , ih.transaction_date_gmt
, ih.from_name, ih.from_company, ih.from_address_line_1, ih.from_address_line_2, ih.from_city, ih.from_state, ih.from_zip
, ih.to_name, ih.to_company, ih.to_address_line_1, ih.to_address_line_2, ih.to_city, ih.to_state, ih.to_zip
FROM ods.sws.create_indicium_log aca --#USPS_Amazon_Cust_Activity aca
JOIN ods.sws.prints p (NOLOCK)
ON aca.transaction_id = p.transaction_id
JOIN ods.sws.transactions t (NOLOCK)
ON aca.transaction_id = t.transaction_id
JOIN ods.sws.create_indicium_log cil (NOLOCK)
ON aca.log_id = cil.log_id
LEFT JOIN ods.pmc.indicium_history ih
ON p.confirmation_number = ih.confirmation_number
END
ELSE IF @meter_number in (SELECT meter_number FROM ods.pmc_dr01.meter_registers)
BEGIN
SELECT 'PHX' as [data_center]
, t.request_time_gmt
, aca.transaction_id
, aca.meter_number
, CONVERT(date, aca.ship_date_gmt) as ship_date
, aca.user_name
, p.confirmation_number
, p.origin_zip
, p.destination_zip
, p.destination_zip_addon
, p.base_postage_cost
, p.mail_class_id
, p.weight_ounces
, p.delivery_confirmation
, cil.ascending_register
, ih.from_name, ih.from_company, ih.from_address_line_1, ih.from_address_line_2, ih.from_city, ih.from_state, ih.from_zip
, ih.to_name, ih.to_company, ih.to_address_line_1, ih.to_address_line_2, ih.to_city, ih.to_state, ih.to_zip
FROM ods.sws.create_indicium_log aca--#USPS_Amazon_Cust_Activity aca
JOIN ods.sws_dr01.prints p (NOLOCK)
ON aca.transaction_id = p.transaction_id
JOIN ods.sws_dr01.transactions t (NOLOCK)
ON aca.transaction_id = t.transaction_id
JOIN ods.sws_dr01.create_indicium_log cil (NOLOCK)
ON aca.log_id = cil.log_id
LEFT JOIN ods.pmc_dr01.indicium_history ih
ON p.confirmation_number = ih.confirmation_number
END
END
Please have look on the comment

Similar Messages

  • Get results from database for the last one week ?

    Hi All,
    I have to make a query for retrieving the data for the last one week from a table say "Orderdata".
    So can anybody please tell me how to retrieve date of last weak from the current date. I mean if current date is 12/08/2004 (mm/dd/yyyy) then I would be needing date as :--
    12/01/2004 (mm/dd/yyyy) to 12/07/2004 (mm/dd/yyyy).
    To more clear, here is the query that am using :
    select * from orderdata where orderdate between 12/01/2004 AND 12/07/2004
    I know I would be needing java.sql.timestamp class to set date . but it is the last thing to do .
    First I have to get date of last weak...........
    Here is the code----------that i have just start to write ..
    Calendar cal;
    TimeZone tz;
    String estTimezone="GMT-05:00";
    tz=TimeZone.getTimeZone(estTimezone);
    cal=new GregorianCalendar(tz);
    cal.setTimeZone(tz);
    String currentdate=String.valueOf(cal.get(Calendar.MONTH)+1);
    currentdate+="/"+String.valueOf(cal.get(Calendar.DAY_OF_MONTH)-1);
    currentdate+="/"+String.valueOf(cal.get(Calendar.YEAR));
    out.println(currentdate);And assume if current date is 12/1/2004 (mm/dd/yyyy) then subtracting -1 form the current date will give 12/00/2004 so not getting the correct result .
    Hope it is clear to all................
    Please Help !
    amitindia

    http://forum.java.sun.com/thread.jspa?threadID=577953&tstart=0

  • How to get result from another JSP file?

    I have to write a jsp (my.jsp) to get information from another jsp file (other.jsp).
    The other.jsp return integer value (0 / 1) so that user can tell if certain service is available or not. And in my.jsp I need to collect such result and other information from a text file to make up of a XML string.
    How can I call other.jsp to get the result? Thanks a lot.

    Hi, I think I didn't describe the problem clearly
    enough. In fact, there is a JSP file, and if our
    database is currently connected, the JSP will return
    value 1, otherwise, it will return 0. My java program
    need to get that result, and then form an XML string,
    and send the string back to the client. I'm just
    wonder how can I write such a program to read result
    from JSP file. Thanks a lot.Why is this function implemented as a JSP file? It should be implemented as a bean. It would be simple to get the information you require from that bean.

  • How to get data from screen for custom field?

    Hi,
    I have added custiom field in header for MIGO_GI transaction using BADI MB_MIGO_BADI by using Method PBO_HEADER, How to get the data from that field into method PAI_HEADER, if any body knows,please let me know.
    Thanks.

    hi
    you need to apppend your custom field in the GOHEAD structure , then automatically you we will get field value in the method IF_EX_MB_MIGO_BADI~PAI_HEADER with internal table is_gohead.
    Pls try once?
    Tks .. venkat

  • How the get most from SapScript for Adobe Printforms ?

    Hi there,
    I would like to know your Ideas and opinion ... about what / how can I reuse Sapscript printing report or/and layout for Adobe Printforms ...
    In particular my requirement is to design new PM Forms (PM_COMMON) in adobe, and Im thinking about to reuse in some way the sapscript printing report.
    Thanks !

    Hello Mr. Sander,
    Till date it is not possible to convert a SAPScript to Adobe forms so the layout changes needs manual changes.
    On the other hand Print programs of sap script can some how be modified and can be used.
    Just need to add this codes.
    DATA :
      w_doc_param       TYPE sfpdocparams,"Doc Parameters
      w_output_param    TYPE sfpoutputparams,
                                           "Output Parameters
      result            TYPE sfpjoboutput. "Joboutput
    DATA :
      fm_name    TYPE rs38l_fnam.          "Function Module name
    This function module is used to specify settings for the form output.
    To specify whether you want the form to be printed, archived, or sent
    back to the application program as a PDF.
    The form output is controlled using the parameters (w_ouput_param)
    with the type SFPOUTPUTPARAMS.
    CALL FUNCTION 'FP_JOB_OPEN'
      CHANGING
        ie_outputparams = w_output_param
      EXCEPTIONS
        cancel          = 1
        usage_error     = 2
        system_error    = 3
        internal_error  = 4
        OTHERS          = 5.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Set the language field the component of structure /1bcdwb/docparams
    w_doc_param-langu = 'EN'.
    Call the function module and passing the form interface values
    CALL FUNCTION fm_name
      EXPORTING
       /1bcdwb/docparams         = w_doc_param
        it_sflight               = it_sflight
    IMPORTING
      /1BCDWB/FORMOUTPUT       =
    EXCEPTIONS
       usage_error              = 1
       system_error             = 2
       internal_error           = 3
       OTHERS                   = 4
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    To complete the processing of the form
    CALL FUNCTION 'FP_JOB_CLOSE'
      IMPORTING
        E_RESULT             = result
    EXCEPTIONS
       usage_error          = 1
       system_error         = 2
       internal_error       = 3
       OTHERS               = 4
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

  • How to get logs from CUCM for initiated calls

    Dears,
    like in Voice Gateway for initiated calls we can run debugs command like debug voip ccapi inout to know the calling and the called number and the status of the call, matched dial-peer, ... etc
    Can we do the same in CUCM
    Thanks in advance for your help

    CDR is used mainly for call statistics, it is not designed for detailed troubleshooting. Reading cucm logs requires a detailed understanding of how different components function and some practice. It can be a little daunting.
    This book is excellent. This is what I always recommend as the starting point..
    http://books.google.co.in/books?id=YcCjKsssklIC&pg=PA42&lpg=PA42&dq=call+manager+trace+reading&source=bl&ots=ZW5_hvNFGA&sig=22rtALJZjQFfe9JrHjgAB_GgtRU&hl=en&ei=4qT3TLfTDsuYOs_I3YwI&sa=X&oi=book_result&ct=result&redir_esc=y#v=onepage&q=call%20manager%20trace%20reading&f=false
    This doc explains how to read h323 traces in cucm
    https://supportforums.cisco.com/docs/DOC-11779
    This blog explains how to understand sip traces..
    https://supportforums.cisco.com/document/113271/understanding-sip-traces

  • How to get result behave differently for one column?

    Hi,
    I have 3 columns in a Bex report say A, B and C.
    C = A % B.
    Results for columns as desired :
    Result of A = Summation of all values of A
    Result of B = Summation of all values of B
    <u><b>Result of C = Result of A % Result of B.</b></u>
    But at present result for C = Summation of all values of C.
    How to achieve the result for C as desired i.e Result of A % Result of B?
    Plz note formula for column C is already there and equal to A% B.
    All help appreciated and rewarded by points.
    Thanks,
    Gaurav
    Message was edited by:
            Gaurav
    Message was edited by:
            Gaurav

    Gaurav,
    Just interested ..
    Isn't your scenario something like this?
    A     B     C (%)
    2     4     50
    2     8     25
    4     12     75  (Result)  this is right 4%12
    Would n't the Result of percentages C be equal to Result of A % Result of B?
    Maybe I am missing something completely.
    Mathew.
    Message was edited by:
            Mathew Muthalaly

  • How to get result from SharePoint site which is on different server.

    We have two SharePoint site on two different server. We want to create search which will search and display content of one one site on other site.
    If this is possible then pls let me know how can I do this. If you have any links/blogs pls share with me.
    Rushikesh_Khadtare

    Hi  ,
    According to your description, my understanding is that you need to create search which will search and display content of one site on other site.
    For your issue, you can deploy a "search center" site in each web app. 
    Any time you perform a search from a search center site, it by default searches all content (using All Content scope) in your index, regardless of web app.
    Take the following steps:
    * Go to  Search Service Application
    * Click Content Sources
    * Select Edit from the Local Office SharePoint Server sites
    * In Start Addresses add the urls of all web applications that you want this content source to crawl
    After a crawl you should now be able to search/find data from all web applications.
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Web services and ADF 11g- get Result from backing bean

    I'm executing an action from backing bean (call Web service that returns complex data types)
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("unesiPonudu");
    Object result = operationBinding.execute();
    result is instance of oracle.adf.model.adapter.dataformat.XMLHandler$DataCollection but DataCollection is not accessible.
    How to get results from method?
    Tnx,
    Andreja

    Hi,
    there should be a result iterator in the Executables section which cotnains the result. If not, create it from the WS result entry in the DC palette. Once this iterator gets updated, you get the data from this iterator as it would be the case of a table accesses the WS
    Frank

  • Forgot icloud password, how to get it recover without any question and also alternative email becuase someone hacked my alternative email id. need password for using icloud hopefully i will get result from you as your earliest.

    forgot icloud password, how to get it recover without any question and also alternative email because someone hacked my alternative email id. need password for using icloud hopefully i will get result from you as your earliest.

    I'm sorry, but I know nothing about iCloud email. I stayed away from iCloud email and only use iCloud for limited purposes.
    But take a look at this discussion and read the response from randers4. He is one of the iCloud experts in the Apple Support Communities.
    https://discussions.apple.com/message/24358339#24358339
    If that doesn't help, you might be better off posting in here where there are other more knowledgable iCloud users.
    https://discussions.apple.com/community/icloud/icloud_on_my_ios_device

  • How to get key from MDX Query

    Hi All,
    how to get key from mdx query ?
    example :
    SELECT [Measures].[67822GFASOU7KUT6FKHSQ34FV] ON COLUMNS NON EMPTY CROSSJOIN([ZCOMPANY].MEMBERS, [ZMILL].MEMBERS) ON ROWS FROM ZODS_GL/ZODS_GL_001
    the result from this mdx query are zcompany text and zmill text, how to get company key and mill key ?
    Regards
    JeiMing

    hi Jeiming,
    to get key in mdx, you can try something like
    [ZCOMPANY].[LEVEL01].MEMBERS
    properties [ZCOMPANY].[2ZCOMPANY]
    following threads may useful
    Extracting texts with MDX
    MDX Statement - display only keys for characterstics and their dis. attrib.
    hope this helps.

  • How to compare result from sql query with data writen in html input tag?

    how to compare result
    from sql query with data
    writen in html input tag?
    I need to compare
    user and password in html form
    with all user and password in database
    how to do this?
    or put the resulr from sql query
    in array
    please help me?

    Hi dejani
    first get the user name and password enter by the user
    using
    String sUsername=request.getParameter("name of the textfield");
    String sPassword=request.getParameter("name of the textfield");
    after executeQuery() statement
    int exist=0;
    while(rs.next())
    String sUserId= rs.getString("username");
    String sPass_wd= rs.getString("password");
    if(sUserId.equals(sUsername) && sPass_wd.equals(sPassword))
    exist=1;
    if(exist==1)
    out.println("user exist");
    else
    out.println("not exist");

  • HT1498 Horrible experience and the movie kept stalling through iTunes on appletv. Gave up (after paying for it) and ended up renting it through cable provider. Anyone know how to get $ back from apple?!

    Horrible experience and the movie kept stalling through iTunes on appletv. Gave up (after paying for it) and ended up renting it through cable provider. Anyone know how to get $ back from apple?!

    Issues are usually network related
    What is your internet speed? www.speedtest.net
    6mbps is required for instant HD (you can switch to SD in the settings)
    If on wifi try ethernet and www.istumbler.net to rule out interference
    Make sure you're using your ISP's DNS

  • How get support from oracle for reports6i

    how get support from oracle for reports6i

    If you have support contract with Oracle, you can use this site:
    http://www.metalink.oracle.com
    or for more information
    http://www.oracle.com/support/premier/global-support-resolution/metalink.html

  • ADM Error processing results from query: Error: Index 0 out of range

    11.1.2.1
    When running quite a large book, we are getting the following error:
    ADM Error processing results from query: Error: Index 0 out of range
    The individual reports in the books are running fine.
    PS.  The report books that are giving this error run fine on 9.3.1
    Could this be a time-out issue and how do we resolve it?

    what is background datasource Essbase or HFM
    do you have lot of data in pov please try below
    >Do you have pov prompt
    >increase jvm heap size for report server in reporting server
    >Fr log files has some more detail

Maybe you are looking for

  • CRVS2010 Beta - Report with many tables

    Hi, I was developing my application first with a test Database with few tables. Now that I am changing to the actual database (with about 200 tables) I noticed that the ReportDocument takes a really long time to load when I tried to access the DataDe

  • Ipad mini battery problems

    hello i have a ipad mini and recently i have been having some problems with it for around one week, i normally leave it charging through the night and when i wake up my ipad says that my battery is at 100% when i take it of the charger it says 99%. s

  • Changing buyer on PO or scheduling agreement

    Hi All, In SAP you have the functionality to send a mail to the buyer when an invoice is blocked for price differences. This mail is being send using the ME partner profile and it determines the buyer from the PO or SA to send the mail. My question i

  • Any 2-Port Routers Out There?

    Hey, I have a airport base station and a PC, both connected to the internet...i have a DSL modem(which is actually pretty fast and im pleased with) but whenever i switch between the internet on the mac and pc i have to switch the wires from my airpor

  • How do I change the webpage that opens in a new tab?

    When I open a new tab, it automatically opens us.search.yahoo.com. I would like google.com to open so I went to about:config and changed the value for keyword.URL from yahoo to google. When I closed FF out completely and reopened it, I tried the new