Trouble with date variables

I have an Oracle Source database and a SQL Server Target database. I need to do the following:
1. Get Max Date from target SQL Server table and assign to a variable
2. Get Max Date from source Oracle table and assign to a variable
3. Create a filter on Oracle source table that includes the statement "Prod_Date >= #Target_Max_Date - #Source_Max_Date"
Variables are Global and are of type "date". My test using one or both variables returne the error: "ORA-00911: invalid character". I know if I write a sub-query to test this in TOAD it works (ie: where Prod_Date <= (select max(Prod_Date)...."
Prod_Date is obviously type "Date".
Suggestions anyone?

Where in operator do I check the format of the date?
Also, I have tried using the following formatting:
Prod_Date >= Prod_Date - ('#FDC_WELL_PROD_EST_Max_Date' - '#Well_Prod_Daily_Max_Date') - 45
Result: ORA-01722: invalid number
A date is a number, so any ideas why the variable is being considered a number?
and
Prod_Date >= Prod_Date - (TO_DATE('#FDC_WELL_PROD_EST_Max_Date','DDMMYYYY') - TO_DATE('#Well_Prod_Daily_Max_Date','DDMMYYYY')) - 45
Result: ORA=-01858: a non-numeric character was found where a numeric was expected.
In this scenario, it would seem we are trying to convert a date to a date?
Appreciate your responses.
Edited by: Becker on Jul 24, 2009 7:13 AM

Similar Messages

  • On order Stock and stock in transit with date variable

    Hi experts.
    İt may be an easy question.
    We need to see  on order stock (menge,can be seen T code MMBE) and stock in transit(T CODE MB5T) with date variable.
    Any T code or table...?
    I mean that  for exp: on order stock and sttock in transit  on 02/02/2012..
    Thanks in advance..

    Hi,
    as per my knowledge you have to develop report using following table
    how many Po closed for material
    how many MIGO happens and how many remain etc
    table EKPO
    EKKE
    EKBE
    MSEG
    MKPF
    [Report|http://wiki.sdn.sap.com/wiki/display/ERPLO/SAPStandardReports]
    [tables req to get date wise stock report;
    Regards
    Kailas Ugale

  • Trouble with session variables

    Hello, I am a user of cf for a number of years, but only
    lately as of last week have I had the opportunity to work with CF
    8.... wow the changes are quite intimidating. But none the less
    press on is my thought, so now my trouble. Thing I did was to start
    using application.cfc vs application.cfm, as it would appear that
    is how things have come to pass. So I looked around and found this
    code to set session management:
    <cfcomponent output="false" hint="Handles application
    level events.">
    <!--- Set up the application. --->
    <cfset THIS.Name = "AppCFC" />
    <cfset THIS.ApplicationTimeout = CreateTimeSpan( 0, 0, 60,
    0 ) />
    <cfset THIS.SessionManagement = true />
    <cfset THIS.SetClientCookies = false />
    <CFSET request.dsn = "wlaw" />
    </cfcomponent>
    My problem is that while I can define a session variable on a
    page that is not under the SSL cert, my session vars become
    undefined once I land on a page under SSL.
    Am I missing something? I dont recall this being a problem in
    the past. All help is appreciated.
    as to setting the var, it is done on an index page which
    calls another page in a different directory, but under the same
    server,.
    <cfset session.ref="foo">
    the only changes are that the result page or action page if
    you prefer is now under the ssl and the var becomes undefined.
    thank you in advance
    Mike Dooly

    is the object being put in session context serializable.. Also in
              other to avoid any generated classes issues delete all the classes
              whcih weblogic generates as part of deploying the application. That
              should atleast mitigate one explanation for your problem.
              Hope this helps
              ~a
              [email protected] (Gabriel Ornelas De Luna) wrote in message news:<[email protected]>...
              > Hello everyone,
              > I'm currently working with WL 6.1 and I'm having trouble with the
              > persistence of some session variables which are initially created
              > correctly on the server side, and they get lost (null) once the Web
              > clients need to access its value.
              > This is the error which is being written on a log file:
              >
              > <May 13, 2003 3:05:09 PM EDT> <Error> <HTTP Session> <Could not
              > deserialize session data
              > java.io.NotSerializableException:
              >
              > Things were woriking perfectly, but suddenly after bouncing the server
              > instance several times, in order to pick up the latest changes in my
              > classes, I started to get this error once the server tries to load the
              > jsp.
              >
              > JSP Code:
              > <%
              > Integer businessID = (Integer) session.getAttribute("business_id" );
              > Util.isCapitolBusiness(businessID.intValue())
              > %>
              >
              > I appreciate your help.
              > Regards.
              > g.
              

  • Error with Date Variable

    I am trying to create a process to import to import data using a date variable but when I use the date to get the data from SQL server I am getting a error.
    I have tried setting the variable as both a string and date - Select
    CONVERT(varchar(10), DATEADD(day, -1, GETDATE()), 101) and map it to the Variable. The date variable is working. It’s correct in the Watch and I am able to use the variable to get data from an Open Link database (row_date = ?)
    in the OLE DB Source query. I get a "Invalid character value for cast specification"
    error when doing the same thing to get data from an SQL Server OLE DB Source
    where the date field is DateTime (row_date = ?). I have tried making the variable as a date and string but get the same error regardless. To make it work, I have to duplicate the date
    calculation in the query - HAVING (row_date = CONVERT(varchar(10), DATEADD(day, -1, GETDATE()), 101) ) which works fine.
    HAVING (row_date = ?) gives the error with the Parameter mapped to the variable.
    Any suggestions as to how to make this work correctly?

    May I suggest to use style 111 instead of 101?
    From experience, yyyy/mm/dd date format will work most of the time for date conversion and
    It's due to different date format from mm/dd/yyyy to the system date format that SQL Server is using.
    Hope this helps.
    ~ J.

  • Problem with Date Variable in Web I

    Hi everybody,
    In the BW I have a query with a Date Variable (0date) and when i execute the WebI report the variable
    shows date and time, like "04/22/2010 00:00:00". Is it possible i remove the
    time from the variable ?
    I need to do this cause i use this date to make some calculation into the WebI report, and with the time the formulas don´t work fine, it shows "#ERRO". I've already tried to insulate the date in other variable using some functions, but it does´t work nevertheless.
    Any idea ?
    Thanks.

    Hi Jordan,
    I would suggest several options.
    First, you have the option within Webi to display only the date and not the time (right click on the object on the report, or go to field properties, and change the format of the display).
    If you are using this value in comparisons in the report, you must make sure the format matches. Try changing the format within the variable to be the same as what you are comparing it to. If that is still not working, let me know. It may still just be a syntax or data type/format error.
    Thanks

  • Trouble with date

    I have some trouble with the date system on my laptop.  Everything is correct on the System Preferences thing.  but when I watch info on a document (e.g. cmd/i) files are registered with dates like 15.6.0034 or 18.5.1119 (Norwegian calendar system dd.mm.yyyy).
    I just registered a test person in the Address book, and it showed 18.5.1120, which is  - in fact - many hundred years back in time!  Ihave done what is called PRAM, and I have run disk utility (verify and repair), but test persons and files are still registered in the year 1120. If I'm lucky I'll manage to get a screen picture here to show you.
    When I use Pages and things, dates are shown correctly, but it is quite annoying not to know when files were registered or updated.
    But I'm sure some of you clever guys will be able to help me! 

    jsa1307 wrote:
    What about this: Whenever I boot into Windows using Boot Camp the date & time is screwed up when I boot back into Leopard. I've tried trashing the localtime file and turning on/off the network time server. Nothing works as a permanent fix. Will I have to reset the time manually every time I change operating systems ??
    If you were to check into the BootCamp forum you would find your answer. It's a common question.
    http://discussions.apple.com/forum.jspa?forumID=1244
    Your issue here is unrelated to that of the original poster and should be reposted in the BootCamp forum.
    Thanks.

  • Trouble with date format

    Hello,
    i need some help with date formats. I am using JDeveloper 11g and am trying to write some SQL commands.
    When i enter the following, everything is working correctly.
    ResultSet query = st.executeQuery("select * from DB.TABLE where DATE > '01-01-2000'");
    I need to make it work so that date can be used from a jtextarea.
    String inputData =jTextArea1.getText();
    ResultSet query = st.executeQuery("select * from DB.TABLE where DATE > " +inputData);
    Query does not return anything.
    Do i need to convert the value of inputData? What other problems could there be?
    TY
    Edited by: user10956166 on Apr 1, 2009 4:08 AM

    Correct. Oracle will implicitly convert the date as shown below (see Predicate Information)
    SQL > explain plan for select * from test where modified_date > '01/01/2008 12:00:00';
    Explained.
    SQL > select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 3461732445
    | Id  | Operation         | Name  | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |       |   677 |   105K|     6   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| TEST  |   677 |   105K|     6   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("MODIFIED_DATE">TO_DATE(' 2008-01-01 12:00:00',
                  'syyyy-mm-dd hh24:mi:ss'))Don't forget to use parameterized queries (a.k.a. bind variables)!
    HTH!

  • APD with date variable in filter object

    Have an APD with a filter object. The filter uses a range for 0CALDAY. the range includes a variable (customer_exit) whic calculates the date of previous fiscal period-end date. Works perfectly in Bex.
    However, when running the APD, the date format comes out as YYYY/MM/DD, and 0CALDAY is expecting MM/DD/YYYY.
    How can I get the internal format of the date correct? I get no errors in the APD, however the date format causes incorrect results, as if no date was entered.
    Any suggestions?
    PS. actually, the internal date format used by the APD for my variable ZCE_PREVPER_END is:
    ZCE_PREVPER_END  = '20101001'
    Needs to be 10/01/2010....
    Edited by: JoeC on Oct 27, 2010 11:39 PM

    Hi Jordan,
    I would suggest several options.
    First, you have the option within Webi to display only the date and not the time (right click on the object on the report, or go to field properties, and change the format of the display).
    If you are using this value in comparisons in the report, you must make sure the format matches. Try changing the format within the variable to be the same as what you are comparing it to. If that is still not working, let me know. It may still just be a syntax or data type/format error.
    Thanks

  • Having trouble with using variables in functions and after functions..

    Morning,
    I have simplified this, as it represents the core of what’s I obviously don't know how to do. 
    Problem:
    Say I populate that variable by reading in a list if IP addresses from file, finding the line that matches the hostname and place that string into the $IPAddress variable for use later throughout the script.   I did not run into a significant problem
    until I decided to convert the routine of looking up the IP address and populating the variable into a function.   As soon as I made it a function, and called that function, the $IPAddress variable only had the data in it until the function completed. 
    Once the function had done its work, and had placed the data into the variable, I expected that “new” data to be available after the function had completed..in that variable.  But it’s like the $IPAddress variable in the main script is a totally
    different data then the variable with the same name that’s used within the function. 
    So I think this demonstrates some of what’s kicking my butt.. 
    $IPAddress = "This is the wrong data”
    Function TestFunction () 
    $IPAddress  #call to display the contents of the variable at the start of the function. 
    $IPAddress = Read-Host -Prompt "Please enter the text ‘Goober’" 
    $IPAddress   #call to display the contents of the variable at the end of the function. 
    TestFunction
    $IPAddress ​
    The output I get is: 
    This is the wrong data
    "Please enter ‘Goober’"  : where I enter Goober
    Goober
    This is the wrong data
    Huh? 
    I had expected:
    This is the wrong data
    "Please enter ‘Goober’"  : where I enter Goober
    Goober
    Goober
    What good is the repeatability of a function if it’s output is lost? 

    THis seems to work.. IS there any reason NOT to do this?
    $Global:IPAddress= "This is the wrong data” #"
    Function TestFunction{
        Write-Host $IPAddress-fore green
          $host.ui.RawUI.FlushInputBuffer()
         $Global:IPAddress =
    Read-Host -Prompt
    "Please enter the text ‘Goober’"
        return$Global:IPAddress
    TestFunction
    return$Global:IPAddress

  • Trouble with private variables

    I have an XML parser running inside a GUI. my problem is that I have the actual parse command inside the actionPerformed method, so that when the user specifies their search conditions, those entities that match those conditions will be the only ones returned from the parse. My problem is that although I have the first thing happening when you hit the search button is to grab the contents of the search fields, the first thing that happens is the XML file is parsed, resulting in a NullPointerException when the parser tries to compare data with the search conditions, which is says are not set. I've already made the strings that will contain the data class-wide variables, but that didn't work. I have found that the variables are set inside the actionPerformed function, but once control leaves that function to the parser, they're no longer set, as if they have been wiped out of scope. any suggestions??

    okay, It is a map with a rubber-banding box for selecting latitiude-longitude coordinates. I have, inside the actionPerformed method, a utility that copies the values inside the textfields into String variables. these variables are declared as private members of the class that both of these methods belong to. I have it set up so that it is supposed to pull the value of the textfields into the strings BEFORE it parses the XML file. I even have the parsing of the XML file inside a finally clause and the setting of the variables in the try, so it's supposed to pull in those variables first no matter what, and it still refuses to get the values.

  • Trouble with float variables

    Hello!
    I'm taking my first java class, and having some trouble. Our assignment is to "change your program so the variables you used to represent the x & y coordinates are declared as the float data type and change their default values to floats. Use the cast operator in your program so your program compiles and the washing maching displays on the screen."
    But, when I changed the variables from "int xval=150" to floats, it won't compile. Anybody have any thoughts? Here's my code:
    public class applet1 extends Applet {
    public void paint ( Graphics g ) {
    float xval=150.0f;
    float yval=150.0f;
    g.drawString ("Pete", 10, 10 );
    g.drawString ("Assignment3 September 18, 2002", 10, 25 );
    g.setColor(Color.white);
    g.fillRect(xval - 150,yval - 150,350,350);
    g.setColor(Color.black);
    g.drawRect(xval-150,yval - 150,350,350);
    g.drawLine(xval - 150,yval - 120,xval + 200,yval - 120);
    g.fillOval(xval,yval - 145,20,20);
    g.fillOval(xval - 105,yval - 145,20,20);
    g.fillOval(xval + 100,yval - 145,20,20);
    g.setColor(Color.lightGray);
    g.fillOval(xval - 100,yval - 100,250,250);
    g.setColor(Color.black);
    g.drawOval(xval - 100,yval - 100,250,250);
    g.setColor(Color.white);
    g.fillOval(xval - 90,yval - 90,230,230);
    g.setColor(Color.black);
    g.drawOval(xval - 90,yval - 90,230,230);
    g.setColor(Color.gray);
    g.fillRect(xval + 170,yval - 110,15,25);
    g.setColor(Color.black);
    g.drawRect(xval + 170,yval - 110,15,25);
    g.drawString ("Whirlpool", xval - 10, yval - 105 );

    You can't use floats when the method requires ints; cast is needed.

  • Problem with Date Variable (Resolved)

    Hi,
    I am using a varibale of type date to populate a constant date value to my target column. My source is excel and target is Oracle.
    When i execute, it shows the following error - 'Unexpected token: 00 in statement'
    I also tried to give an sql qurey for the variable as 'select sysdate from dual'. It's of no use.
    Can anyone help me out in this?
    Thanks in Advance,
    Ram Mohan T
    I used the target execution instead of Staging Area. It worked fine.
    Edited by: T. Ram Mohan on Aug 30, 2008 9:37 AM

    Hi Jordan,
    I would suggest several options.
    First, you have the option within Webi to display only the date and not the time (right click on the object on the report, or go to field properties, and change the format of the display).
    If you are using this value in comparisons in the report, you must make sure the format matches. Try changing the format within the variable to be the same as what you are comparing it to. If that is still not working, let me know. It may still just be a syntax or data type/format error.
    Thanks

  • Query with date variable selection

    Greetings,
    I am having problems with a SQL Query and wondering if someone could help me out.  I have the following query and want to specify a WHERE clause and have the user select the date range they want to work with.  If I specify a date the query runs fine.  If I enter in the [%0] I get an error message saying: "incorrect syntax near '<'.
    Any help would be appreciated.
    select
    'W' as prefix,
    empid as [Employee Number] ,
    U_PayrollCat as [Payroll Category Code],
    '' as [Cost Center Code],
    ContractID as     [Job Center Code],
    Segment_0 + isnull( ActSep + Segment_1, '') + isnull(ActSep  + Segment_2, '') 
                          + isnull(ActSep + Segment_3, '') + isnull(ActSep + Segment_4, '') 
                          + isnull( ActSep  + Segment_5, '') + isnull(ActSep + Segment_6, '')
                          + isnull(ActSep + Segment_7, '') + isnull(ActSep  + Segment_8, '')
                          + isnull( ActSep + Segment_9, '') as [GL Account Code],
    quantity as Units,
    U_NBS_ITEMCOST/quantity as Rate,
    U_NBS_ITEMCOST as Amount,
    oclg.notes as Comments,
    oclg.recontact as [WorkDate],
    '' as[Department code]
    from
    oclg inner join
    dln1 on dln1.docentry =oclg.docentry inner join 
    odln on odln.docentry = dln1.docentry inner join
    ohem on ohem.userid = oclg.attenduser
    inner join oitm on oitm.itemcode = dln1.itemcode
    inner join oscl on oscl.callid = odln.U_NBS_S1Link
    inner join OACT on  OACT.AcctCode = dln1.cogsAcct
    inner join oadm on 1=1
    WHERE
    oclg.recontact >= [%0] AND oclg.recontact <= [%1]

    Gordon,
    That worked with a few modifications.  Removed comma on line before FROM clause and my UDF for Payroll Category is on my OITM table.  Complete Query looked like this:
    SELECT 'W' as prefix, t3.empid as 'Employee Number',
    t4.U_PayCat as 'Payroll Category Code',
    t5.ContractID as 'Job Center Code',
    t6.Segment_0 + isnull( ActSep + t6.Segment_1, '') + isnull(ActSep + t6.Segment_2, '')
    + isnull(ActSep + t6.Segment_3, '') + isnull(ActSep + t6.Segment_4, '')
    + isnull( ActSep + t6.Segment_5, '') + isnull(ActSep + t6.Segment_6, '')
    + isnull(ActSep + t6.Segment_7, '') + isnull(ActSep + t6.Segment_8, '')
    + isnull( ActSep + t6.Segment_9, '') as 'GL Account Code',
    t1.quantity as Units,
    t1.U_NBS_ITEMCOST/t1.quantity as Rate,
    t1.U_NBS_ITEMCOST as Amount,
    t0.notes as Comments,
    t0.recontact as WorkDate
    from dbo.oclg t0
    inner join dbo.dln1 t1 on t1.docentry =t0.docentry
    inner join dbo.odln t2 on t2.docentry = t1.docentry
    inner join dbo.ohem t3 on t3.userid = t0.attenduser
    inner join dbo.oitm t4 on t4.itemcode = t1.itemcode
    inner join dbo.oscl t5 on t5.callid = t2.U_NBS_S1Link
    inner join dbo.OACT t6 on T6.AcctCode = t1.cogsAcct
    inner join dbo.oadm t7 on 1=1
    WHERE t0.recontact >= '[%0]' AND t0.recontact <= '[%1]'
    Thanks for the help,
    Aaron

  • Trouble with evaluating variable

    I'm having a problem using a variable and evaluating it in a package and created a simple example to see what was happening.
    1. Created a project variable; type = numeric
    2. Created a package with a couple of steps:
    a. First step sets the variable to zero.
    b. Next step increments it by 1.
    c. Next step evaluates whether the variable is greater than zero.
    d. Final step sends me one email message if value > 0; if not it sends me a different message.
    When I execute the above package everything works as I would expect. The value of the variable at the end is 1 and I get the email I'm expecting.
    I then moved the step that increments the variable (2b) into its own package. I then replaced step 2b with a step to execute the scenario which updates the variable. Now when I run the package I can see that the value of the variable at the end is still 1; however, the process now takes the branch in 2d for when the variable is NOT greater than zero.
    Is this just how ODI works or am I missing something? Can you not set a variable in one scenario and then evaluate it from the called scenario? Is it a scope thing? In my example the interfaces/packages/scenarios/viarables are all in the same project.
    Thanks.

    Actually, each odi SESSION keeps its own variable values.
    So, when you execute a child-scenario, you must pass the value of the variable from master package to child scenario.
    To do that, you must :
    1) enter the name of the variable in the tab called "additionnal variables" of the step
    2) put the variable in the child package in DECLARE mode

  • Template with data variables will not insert ampersand

    Dear clever people
    I have an illustrator template (saved as .ai) which contains some text boxes and some images. I have tagged these as text and linked file dynamics, so that I can create a series of files with slightly different text and pictures when I load a variable library from an xml file.
    My problem - some of my text routinely includes ampersands and whenever I try and load a variable libaray containing "&" I get an error message saying "The filter cannot complete because of an unkown error."
    Is there some way I can explain to Illustrator what an ampersand is, and that refusing to insert it into my template is not the sort of helpful behaviour expected of a computer application?
    I'm using illustrator 10.0.3 with windows xp.
    Thank you in advance for any replies!

    Not sure, but sounds like a coding problem. The usual way to avid these is to "escape" characters by preceding them with a backslash in the source database/ document. \& might therefore work. Another way is to enclose it in quotes "&". Dunno, I came here for help myself, but these are generic programming tips that may work.
    Mylenium

Maybe you are looking for

  • Create a visual web part which get data from excel sheet and import it into sql server database in sharepoint 2010 (development)

    Hi, I want to create a visual webpart which will read data from excel sheet and import it in to sql server database.(using sharepoint development) I want to do it using visual webpart. Please help to solve the issue. Thanks in advance! Regards Rajni

  • Is it possible to create video material from the new Apple Maps app? Has anyone attempted this?

    I'm interested in creating a mini movie/video of key locations on Apple maps. Can you plot, rotate 3D, flyover a number of locations to tell a story and then download it as a movie? Anyone attempted this?

  • Reports 10g - Dynamic Alignment?

    Hi, On my report let say I am displaying 3 sets of data (Ex: Employees data, Dept data & HR data). I want my report to be aligned in the Center. For any reason if I dont get back any data for Depts, does the report dynamically align itself or does it

  • Integrate SAP DMS with SAP CRM

    Hi Experts. I'm currently performing an analysis to evaluate if SAP CRM and DMS are the ideal tools to replace a legacy system which has workflow and document management capabilities. Thus I've been consulting the Documentation at http://help.sap.com

  • Wish to learn BPM

    Hello Experts, I work in SAP MDM field and I wish to learn BPM. I have a few basic questions regarding the same: 1. What is the pre-requisite to learn BPM? I mean is JAVA etc required to learn BPM? 2. Can you please brief about BPM and also links to