How does a Date Parameter get interpreted using an Oracle Query

I have a SSRS Report which utilizes an Oracle Data Source and the following query...
select TRIM(to_char(TO_DATE(:mydate),'Month')) || ' ' || TRIM(to_char(TO_DATE(:mydate),'YYYY')) as compare_month,
cs.contract_nbr,
m.hcfa_nbr,
m.fname,
m.lname,
cs.group_nbr,
cs.division_nbr,
to_char(to_date(cs.ymdeff,'yyyymmdd'),'mm/dd/yyyy') as date_eff,
to_char(to_date(cs.ymdend,'yyyymmdd'),'mm/dd/yyyy') as date_end,
ssw.num_months,
ssw.ssa_premium_collected,
ssw.ssa_penalty_collected
from amiown.contract_span cs
left join (select distinct
m.member_nbr,
m.contract_nbr,
trim(m.firstname) as fname,
trim(m.lastname) as lname,
m.hcfa_nbr
from amiown.member m
inner join amiown.member_span ms
on ms.member_nbr = m.member_nbr
and trunc(to_date(:mydate),'Month') <= to_date(ms.ymdend,'yyyymmdd') -- beginning of month is <= than end of span
and add_months(trunc(to_date(:mydate),'Month'),1)-1 >= to_date(ms.ymdeff,'yyyymmdd') -- end of month is >= than beginning of span
and ms.void = ' '
and ms.class_x = 'CH' -- contract-holders only
) m
on cs.contract_nbr = m.contract_nbr
left join (select hno.member_id,
substr(hno.member_id,1,9) as contract_nbr,
pw.hic_number,
pw.report_date,
pw.start_date,
pw.end_date,
pw.num_months,
pw.part_c_collected + pw.part_d_collected as ssa_premium_collected,
pw.penalty_collected as ssa_penalty_collected
from SC_BASE.hcfa_arch_premiumwithhold pw
left join SC_BASE.hcfa_name_org hno
on pw.name_id = hno.name_id
where pw.report_date between pw.start_date
and pw.end_date -- filter out adjustments
and trunc(to_date(:mydate),'Month') <= pw.end_date -- beginning of month is <= than end of span
and add_months(trunc(to_date(:mydate),'Month'),1)-1 >= pw.start_date -- end of month is >= than beginning of span
order by substr(hno.member_id,1,9)
) ssw
on trim(cs.contract_nbr) = trim(ssw.contract_nbr)
where cs.division_nbr like '%SSW%'
and cs.void <> 'V'
and trunc(to_date(:mydate),'Month') <= to_date(cs.ymdend,'yyyymmdd') -- beginning of month is <= than end of span
and add_months(trunc(to_date(:mydate),'Month'),1)-1 >= to_date(cs.ymdeff,'yyyymmdd') -- end of month is >= than beginning of span
The :mydate parameter is defined in the .rdl with a Data type: of Date/Time
I am trying to trouble shoot this by using a Linked Server to Oracle and even going against Oracle itself...providing the following syntax because I believe this is what's being sent over via SSRS...
WHERE   TRUNC(TO_DATE(11/30/2014 00:00:00), 'Month')        <=      HCFA_ARCH_PREMIUMWITHHOLD.END_DATE
However, every time I try this, I get an Oracle error...ORA-01843: not a valid month
Can anyone help me out in the data transformation from SSRS to Oracle and the syntax that actually gets passed over so that I can try and troubleshoot this?
Thanks for your review and am hopeful for a reply.

Hi ITBobbyp,
Please add the myDate field in the report to check if the myDate have the format like:'MM/DD/YYYY hh:mm:ss AM' or 'MM/DD/YYYY hh:mm:ss PM', If so, your issue can be caused by the format of the :mydate  parameter which is like 'MM/DD/YYYY hh:mm:ss AM'
or 'MM/DD/YYYY hh:mm:ss PM' in the report ,so it have extra ' AM' or ' PM' compare with that in the TRUNC(TO_DATE('11/30/2014 00:00:00'), 'Month').
You can get the format wanted 'MM/DD/YYYY hh:mm:ss' from 'MM/DD/YYYY hh:mm:ss AM' as below:
You can create an new calculated field to get the new date by using expression as below and then create the parameter based on this calculated field:
=Fields!DateTime.Value.ToString().Replace(" AM","").Replace(" PM","")
You can also hide the :myDate parameter and then create an new parameter(NewMyDate) based on the :myDate
parameter which will have the format like 'MM/DD/YYYY hh:mm:ss':
Specify the available value and default value using below expression:
=Parameters!myDate.Value.ToString().Replace(" AM","").Replace(" PM","")
Then you can use the @NewMyDate to add in the query to filter the data.
If you still have any problem, please feel free to ask.
Regards
Vicky Liu
Vicky Liu
TechNet Community Support

Similar Messages

  • How does committed date in STO- different company codes gets calculated

    Dear All,
    Please let us know How does committed date (ATP date) in the STO across different company codes gets calculated
    Regards
    Ahmad Idais

    Hello,
    RA is always a Company Code specific process due to the possibility of financial postings.  I think that your WBS structure better be reconsidered not to mix up different Company codes at different levels, but maybe having a parallel nodes for different Company codes.
    I also believe there is a consulting OSS note to explain the standard system behavior, just search the OSS.
    Since you already have a master data in place it must be quite easy for you to test how the system behaves.
    Regards,

  • How does IDOC data transfer happensbetween two system?

    Hi,
    If there are data in system A and I need to transfer to system B using IDoc.
    What are the key things which will enable data transfer from system A to system.
    It would be great if someone can explain how does IDOC data gets transferred from system A to sytemB.
    Regards,
    Rachel
    Moderator Message : Search for available information or Read SAP documentation. Thread locked
    Edited by: Vinod Kumar on Apr 26, 2011 12:37 PM

    thanks for all your replies...
    let me write down what i have understood ..plz correct me if i have not followed properly..
    1) Once IDocs successfully reach R3 , a function module specific to the Idoc type is called "<b>automatically</b>" and updates database...
    2) this function module we specify in the process code while creating partner profiles
    basically all we need to do is to specify correct function module, right?
    the rest of the process ie . updation in the tables(database) is done automatically..
    Once database is updated, where can i see the added/updated records in database?
    also how do we find this function module?
    I am using MATMAS05...
    Regards,
    Roshani

  • How to pass Cascading Parameter in SSRS using Java

    How to pass Cascading Parameter in SSRS using Java---
    We are having a problem with dependent parameters.There are three drop down--
    1.first dropdown is of Country.When we select a country--Accordingly next dropdown(State)will populate
    2.Second dropdown is of State. When we select a state--Accordingly next dropdown(City)will populate.
    I have three data sources are
    CountryList-
    SELECT CountryRegionCode, Name
    FROM Person.CountryRegion
    ORDER BY Name
    StateList
    SELECT StateProvinceID, StateProvinceCode, CountryRegionCode
    FROM Person.StateProvince
    WHERE CountryRegionCode = @CountryRegionCode
    ORDER BY StateProvinceCode
    CityList
    SELECT StateProvinceID, City
    FROM Person.Address
    GROUP BY StateProvinceID, City
    HAVING (StateProvinceID = @StateProvinceID)
    ORDER BY City
    Ihave to show report that has been deployed on server on the besis of these parameters
    I am using ReportViewer in JSP Page through url--
    http://192.168.90.149/ReportServer/Pages/ReportViewer.aspx?%2fReport+Project1%2fCascading_Parameters&rs:Command=Render&rs:parameter=true&Country="+Country+"&State="+State;
    But it is not accepting parameter if they are cascaded.It is working fine if Both parameters are independent.
    Edited by: kaushlee on May 11, 2010 9:22 PM

    Take a look at set_custom_property:
    public static final ID SETTEXT = ID.registerProperty("SETTEXT");
    public boolean setProperty(ID pid, Object value)
        if (pid == SETTEXT)
    String text = value.toString();
    and in forms
    set_custom_property('beans.bean_item', 1, 'SETTEXT', 'some text');
    cheers

  • I need to find out how much wifi data my apps are using. I have a very limited amount of wifi data, and I am exceeding my monthly allowance. Apparently, even apps I think are not open are sending/receiving data through the wifi and using up my allowance.

    I need to find out how much wifi data my apps are using. I am on a very limited amount of WiFi data each month, which I am regularly exceeding. I have been told to work out which of my apps is using the data. Also, I think I have closed an app by double clicking the home button, then swiping the app up - is this the way to close it, or will it still be sending/receiving data?

    Go into your Settings : General : and turn off background refresh for your apps.  In Settings : Mail  turn Fetch new data to OFF and Load Remote Images to OFF.  This will mean that Mail will only check for messages when you actually use it, and all your advertising junk mail won't have all the images in it.
    Turn off push notifications every chance you get.
    Make sure you are actually quitting apps:  to quit apps press the Home button twice and you should see a bunch of smaller screen images for every open app.  To quit the app swipe from the screen image (not the icon) upward off the top of the iPad.  You can swipe left and right to see more open apps, but there must be no left-right movement on the screen when you swipe upward to close the app.
    Turn off your internet connection when you do not need it.  The easiest way to do this is to swipe up from the bottom of you screen to get the control centre, and then touch the airplane to turn on airplane mode.  You can repeat this sequence to turn it back on again when you need it.  Most especially turn airplane mode on whenever you are sleeping your iPad for long periods.  This will save battery life too.  OR actually turn your iPad off - which means holding the power key down for several seconds until the red swipe bar appears, and then swipe to turn it off.  If you go this route, note that it will take longer to turn on then it takes to wake from sleep.

  • HT204350 Incorrect link to "OS X: How to migrate data from another Mac using Mountain Lion and earlier"

    Incorrect link to "OS X: How to migrate data from another Mac using Mountain Lion and earlier". Should be http://support.apple.com/kb/HT6025

    I think the OP is saying OS X: How to migrate data from another Mac using Mountain Lion and earlier (which should be a link to HT4889) just links back to OS X: How to migrate data from another Mac using Mavericks (HT5872).
    It does indeed do that, & HT4889 seems to be MIA.

  • How does a Purchase Order get into 'Approved, Reserved' status?

    How does a Purchase Order get into 'Approved, Reserved' status?

    Hi,
    When an approved purchase order is unreserved and the GL date is modified and re-submitted for approval, the document (PO) gets reserved and approved status.
    I believe you put this question in a wrong thread (Financial), next time onwards, please put your question in correct thread and I am sure you will get the solution faster :).
    Regards,
    S.P DASH

  • How describe model data and  get select in DB throw topLink.

    Hello,
    I have table from code
    create table t_tree
    id int primary key,
    parent_id int,
    value varchar2(255)
    Alter table t_tree
    add constraint constr_id_parent foreign key (parent_id) references t_tree (id)
    I must get query
    select level as lv,lpad('-@-', (level-1)*2)||value as MMM, t.* from t_tree t
    connect by prior id=parent_id
    start with T.PARENT_ID is null
    How describe model data and get select in DB throw topLink.
    Dema.

    So you'll probably have to write a function which uses dynamic SQL to retrieve the desired message text, like this untested one:
    CREATE OR REPLACE FUNCTION get_msg(p_db IN VARCHAR2,
                                       p_id IN NUMBER)
       RETURN VARCHAR2
    IS
       msg_txt  VARCHAR2(4000);
    BEGIN
       -- make sure p_db is a valid database link ...
       EXECUTE IMMEDIATE 'SELECT d_msg FROM msg@' || p_db || ' WHERE t_id = :id' INTO msg_txt USING p_id;
       RETURN msg_txt;
    EXCEPTION
       WHEN NO_DATA_FOUND THEN
          RETURN NULL;
    END get_msg;
    /The you can update likeUPDATE mex
       SET t_msg = get_msg(db_id, t_id);Hth, Urs

  • How does the MDKP table gets updates

    Dear PP Guru's,
    I am new to SAP PP,
    We have a query that how does the MDKP table gets updates,
    Some time If we create new material by coping the material which is showing in table MDKP,
    But new material is not showing in table MDKP,
    Based on table MDKP we are fetching some data, due to above problem we are not able to fetch the data for some materials,
    Please suggest what could be the reason,
    Any help will be highly appreciated,
    Thanks in advance,
    Sachin.

    Thanks Thaila,
    I have checked the same by doing MRP through MD02 & the entry is getting update in MDKP,
    But for some of our materials MRP (MD02) is done earlier, but these materials are not showing in MDKP,
    Please suggest, when the entries in MDKP are removed, are there any conditions for removing the entries from MDKP.
    please pour some light on the issue,
    Thanks once again,
    Sachin.

  • How does the system identifies whether we use Psotive or Negative Time Mngt

    Dear All,
    How does the system identifies whether we use Psotive or Negative Time Management.
    Appreciate your early response.
    Regards
    Rajesh

    Hi
    1. In positive time management we record the actual time of the employee working in organization and following are the infotypes we need to maintain in master data,
              1. Organztion Assignement [0001]
              2. Personal Data [0002]
              3. Absence Quota [2006]
              4. Planed working time [0007] with the time management status " if you are using PDC then "2" " Or "1. Time evaluation actual time".
              5. Time Recording Info [0050]
    2. In Negative time management we are only recording the time deviation like "Absence, Illness, Leave" and following are the Infotype we need to maintain in master data,
             0001, 0002,0007 with time management status "0" i.e No time evaluation and 2006.
    Best of Luck
    Swapnil

  • How does one go about getting the Kit Kat upgrade?

    I've searched the Verizon site ad I can't find how to download it.  Must one be selected?

    Thanks for your reply.  I went to Settings and About Phone, however, there was a "System updates"  that showed a history and a "Check for new software update" key.  I tried that and it returned with Your phone is up to date.  I guess I'll have to wait for Verizon to send me an update.
           From: clydefrog4963 <[email protected]>
    To: John Manning <[email protected]>
    Sent: Sunday, December 7, 2014 5:20 PM
    Subject:  - How does one go about getting the Kit Kat upgrade?
    #yiv6222900142 img
    |  
    |
      | 
    A message from the Verizon Wireless Community
      |
    |   |
    How does one go about getting the Kit Kat upgrade?
    created by clydefrog4963 in Samsung Galaxy Note 3 - View the full discussionVerizon has started pushing the 4.4.4 KitKat update on the Note 3, I got mine today. It poppped up when connected to my computer on Kies but you can do it on your phone by going to settings, all the way to "about phone" at the bottom, then click on "software update." Its best to do this while connected to wifi, and make sure your phone is at least half charged. Reply to this message by replying to this email -or- go to the message on Verizon Wireless Community Start a new discussion in Samsung Galaxy Note 3 by email or at Verizon Wireless Community


    © 2014 Verizon Wireless
    Verizon Wireless
    One Verizon Way
    Mail Code: 180WVB
    Basking Ridge, NJ 07920
    Not interested in these emails anymore, or want to change how often they come? Update your email preferences by visiting https://community.verizonwireless.com/user-preferences!input.jspa.
      |
    We respect your privacy. Please review our privacy policy for more information
    about click activity with Verizon Wireless and links included in this email.
      |

    |

  • How to select data from a table using a date field in the where condition?

    How to select data from a table using a date field in the where condition?
    For eg:
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
                                                      and bdatu = '31129999'.
    thanks.

    Hi Ramesh,
    Specify the date format as YYYYMMDD in where condition.
    Dates are internally stored in SAP as YYYYMMDD only.
    Change your date format in WHERE condition as follows.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and bdatu = <b>'99991231'.</b>
    I doubt check your data base table EQUK on this date for the existince of data.
    Otherwise, just change the conidition on BDATU like below to see all entries prior to this date.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and <b> bdatu <= '99991231'.</b>
    Thanks,
    Vinay
    Thanks,
    Vinay

  • How does one transfer CS5 actions for use with CS6?

    CS6 installation, which was uneventful, has transferred none of my actions from my copy of CS5. The CS5 actions are located in the actions folder of the APPLICATION/PHOTOSHOP CS5/PRESETS/ACTIONS.  The "actions" folder in application support/adobe in my library is empty, and has always been so.
    Only the CS6 default actions are located in the same folder for CS6.
    I use imac i7, lion.
    Note that i also have CS3 and CS4 on my machine. This due to recent upgrade to CS5 and recent upgrade to LION, and my general paranoia.
    Must i load each action into CS6, one at a time?
    thanks to any and all.
    vince

    Re: how does one transfer CS5 actions for use with CS6?
    On a Mac - There are multiple ways to do this.  I have done them both ways. In order to do this you need to know where you have your actions stored, and you can move them all at once if you have them stored in the same location.
    1. You can load an action ONE AT TIME into your actions palette by:
         A. Open up the action palette and click on the little arrow with 4 little horizontal lines next to it on the upper right corner of the actions palette.
         B. Select "Load Actions" and a Finder window will open up and you can search your computer through this window for your actions.
         C. Click on the action from the Finder window then click 'Open' at the bottom right of the finder window.
         D. To save these so that they appear every time you open up your actions palette, go back to the little arrow at the top right of the actions palette and when the drop down window opens- click on 'Save Actions'. It will select the location where the          actions are currently stored as the place to save them. If you want to change that path, you can do it at this time in the little path window.  I just leave it, since I keep all my actions stored in the same file.
    2. TO MOVE MULTIPLE ACTION SETS AT ONCE
         A. Open up CS6 (or CS5) and move the Photoshop workspace it to the right side of your computer screen so you can see your desktop on the left side.
         B. Open up your Finder search window from your dock (the square blue head icon thingy for those who are new to photoshop). Move this to the left side of your screen so you can see the Photoshop work space on the right and the Finder window          on the left. In the Finder window, navigate to the file where all your actions are stored, select all the actions in the file (command+A will select everything in the file if you are actively inside the open file) or you can select multiple files           individually by continuously holding down the command key and clicking on the different actions you want to move.
         C. With the Photoshop workspace visible on the right, and the actions palette open so you can see that the actions actually transferred - In the Finder window, click the selected actions you want to load and drag them over to the Photoshop           workspace.  I did this without an image open, I just dragged them onto the empty workspace.  The actions should all appear immediately in the actions palette that is open.
         D. To save these so that they appear every time you open up your actions palette, go back to the little arrow at the top right of the actions palette and when the drop down window opens click on 'Save Actions'. It will select the location where the           actions are stored as the place to save them. If you want to change that path, you can do it at this time in the little path window.  I just leave it, since I keep all my actions stored in the same file.
    I hope this helps. 
    and I hope there are no typos. 

  • How to write data to text file using external tables

    can anybody tell how to write data to text file using external tables concept?

    Hi,
    Using external table u can load the data in your local table in database,
    then using your local db table and UTL_FILE pacakge u can wrrite data to text file
    external table
    ~~~~~~~~~~~
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7002.htm#i2153251
    UTL_FILE
    ~~~~~~~~~
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#sthref14093
    Message was edited by:
    Nicloei W
    Message was edited by:
    Nicloei W

  • How to load data into html:select using Struts ?

    How to load data into <html:select> using Struts ?
    I can not load an array or collection (static or dynamic data) into drop down list control by <html:select /> Struts.
    please use:
    <html:select >
    <html:options />
    </html:select >
    Please help me. please detail it. thanks a lot.
    Message was edited by:
    tranminhman

    In order to load a collection or array of data you can use <html:select> with <html: options collection="" name=""/>
    here collection attribute refers to the Arraylist or Array of data and name is the name of the Form bean.
    Hope this helps...
    Chaitanya V

Maybe you are looking for

  • Won't mount

    Hi all, my G3 was acting sluggish so I decided to zap the PRAM and rebuild the desktop.... Well, the PRAM cleared OK, but as I was using TechTool to delete/rebuild the desktop, it froze. Now the machine will NOT boot up. It starts up; loads the exten

  • Information in outlook

    I am trying to retrieve the information embedded in the info tag in outlok MeetingItem/AppointmentItem . Does anyone know how could I access this information programatically from c#. I am able to retrieve store, MeetingItem and AppointementItem but t

  • Maintenance Tools Assignment/Tracking/Issue to Employees.

    Dear All, We have Implemented Plant Maintenance Module for Manufacturing Plant. Maintenance department issue certain maintenance power tools/tool box to maintenance technicians to perform their daily/routine maintenance activities. We want to maintai

  • Calibration

    I have written a vi in LabView, it reads from a strain gauge and is used to measure chocolate bars (this is a second year engineering design assignment). I have to plot a graph of applied weight vs reading as part of the calibration process. I was wo

  • After software update I cannot open outlook express

    after software update I cannot open outlook express