Strange date query

In my procedure I convert a varchar input to a date as:
lv_mydate := to_date(p_passed_date,'mm/dd/yyyy')
The p_passed_date is a varchar type and lv_mydate is a date type
Now, when I use this lv_mydate in my select query no rows are returned although there are mathing ones. But, when I apply to_date to the lv_mydate variable as:
select....where..datecol=to_date(lv_mydate,'dd-Mon-yy')
I get the matching rows. Is this a bug or I'm missing something over here?

Check your session env.:
[email protected]> select * from nls_session_parameters where parameter = 'NLS_DATE_FORMAT';
PARAMETER VALUE
NLS_DATE_FORMAT dd-mm-yyyy hh24:mi:ss
You should convert parameter to the format used in your session than it should work without to_date in where clause
Best Regards
Krystian Zieja / mob

Similar Messages

  • Many messages are showing up randomly on my mail.they say no message and no sender and give very strange dates.  The text is gray - I can't delete them. What is this?

    Many messages are showing up randomly on my mail.  They say no message, no sender and have strange dates.  The text is gray; I cannot delete them.  What is this?

    The Best Alternatives for Security Questions and Rescue Mail
        a. Send Apple an email request at: Apple - Support - iTunes Store - Contact Us.
        b. Call Apple Support in your country: Customer Service: Contacting Apple for
            support and service.
        c. Rescue email address and how to reset Apple ID security questions

  • Shared photo stream wrong / strange date

    When adding photo's to a shared photo stream sometimes strange dates appear.
    The problem happens with scanned negatives. In my libarary I sort all photo's on date, so I have changed the date of all these scanned negatives and applied them to the originals.
    The photo's in my normal libary show the correct date and time, however when I put the photo's in the shared photo stream it all of a sudden changes to a different date...???
    It might well be the scanned date that the negatives were actually scanned, but this orignial date is nowhere to be found in the metadata.
    I have done some testing and it also does not matter what the actual creation, modification, and last opened date of the file is.
    Anybody any idea where this original date is residing in the file, how can I change it, and why is the shared photostream taking this date instead of dates in the aperture library.
    Thanks !!

    The dates can be seen in the List View.
    How ever in the project from where I shared the photo the date is correct:
    These photo's are shot on film, yes good old film (as in the once you had to bring the a specialist to be developed and then printed). These negatives were scanned to jpg's and the jpg's imported in Aperture.
    In Aperture I then painstakingly gave the right dates and approximate time, to be in the right order. (At this event at the same time there was somebody with a digital cam, so they are in the same project mixed with the scannes)
    When adjusting the time, I also wrote the changes to the original file. However, somewhere Aperture remembers this date the pcitures were created eventhough the original file does not contain this date anymore (as far as I tell).
    Since the photostream also uses the date for ordering the whole order is mixed-up...

  • How can I use FK description in a BC4J data query component?

    Hi all,
    I am facing the following problem.
    Although I use renderers in the DataEdit component for displaying the descriptions of the FKs this is not useful for the BC4J data query components.
    How can I get the same functionality as in the dataEdit components?
    Thanks in advance,
    Aggelos

    Anfortunately,
    This is not the same when I have a DataQuery component.
    The question now becomes as following:
    How can I use FK description in a BC4J data query component?
    Thanks in advance
    Aggelos

  • Hierarchical Tree Data Query/Record Group Question

    I need help with Hierarchical Forms right now. I'm currently trying to implement a hierarchical tree to display the different items in different categories. I have been reading up on it for the past few days, and i do not understand a few things.
    What is the difference between a data query and record group? they seem the same to me.
    How does the XX = prior XXX work? i understand that this is what connects the parent to the child.
    How do you determine what depth the node is? its done in the record group/data query, but how do i decide what level it is dynamically?
    Thanks a lot in advance!

    Thanks! I am unable to create a table specifically for the tree because i am using tables that have been ported live and are in use. My question about levels is how do I know which depth the node is. For example, i have a category called Information Technology and a category item called Business Informatics. I want to know how to decide that the Category(information technology) is on level 1 and the Item(business informatics) is on level 2.
    Information Technology
    |_
    Business Informatics
    And i do know how the Connect By XX = prior XXX works in the data query/record group.
    Thanks for your help!

  • Strange Date Format: April 16, R.O.C. 98 23:11:44 MESZ

    Hello,
    my Snow Leopard Mail.app suddenly shows me a strange date format:
    April 16, R.O.C. 98 23:11:44 MESZ
    (also see http://de.tinypic.com/r/153pjpz/3)
    My question would be, what does R.O.C. 98 mean and how can I get rid of it?
    Thank you very much!
    Till

    Reboot solved it. In these times, you don't even think about something this trivial.

  • JSP Data Query tag and case sensistivity

    Hello,
    When using BC4J Data Query tag in JSP apps how to make queries case INSENSITIVE? I undestand that string comparison in Oracle is case sensiteve and hence my dynamic query will be also. However, I would like to do something like
    select * from bla
    where upper(attribute) = upper(string) where the string is from the JSP query form entered by user.
    rade

    Use a standard INPUT tag combined with the DataValue tag. This will allow you to control the input tag while still getting the data from a BC4J attribute.

  • Date Query for SimpleDateFormat

    HI,
    I’m trying to create a Toplink query for Date. Toplink always generates the date query in the following format for my Oracle DB:
    1.     If I pass the value new Date() in then it generates
    to_date('2005-01-05 30368','yyyy-mm-dd sssss')
    2.     If I use SimpleDateFormat with the format “yyyy/mm/dd" it creates
    to_date('2007-07-05 0','yyyy-mm-dd sssss')
    What is the value that comes after the day (30368 and 0) in each query?
    How can I make the Toplink to generate date without the time component? Preferably if there is a way for toplink to generate the date based on the Java SimpleDateFormat that would be good.
    Thanks
    -Mani

    The DATE type in Oracle stores both a date and time. The 0/30368 is the time in seconds sssss, 0 means no time. You should not have any issue with this format, what are you trying to do?

  • Date query problem

    Hi,
    On a report I'm trying to do a date query:
    select * from table v
    where ..........
    and ( to_date(v.fecha_inicio, 'dd/mm/yyyy')
    between nvl(to_date(:P_BEGIN, 'dd/mm/yyyy'),
    to_date('01/01/0001', 'dd/mm/yyyy'))
    and nvl(to_date(:P_END, 'dd/mm/yyyy'),
    to_date('31/12/9999', 'dd/mm/yyyy')) )
    and could not get the right data (return no rows), I though it was a problem with my itmes so changed the item reference for the actual values:
    select * from table v
    where ..........
    and ( to_date(v.begin_date, 'dd/mm/yyyy')
    between nvl(to_date('01/10/2006', 'dd/mm/yyyy'),
    to_date('01/01/0001', 'dd/mm/yyyy'))
    and nvl(to_date('31/10/2006', 'dd/mm/yyyy'),
    to_date('31/12/9999', 'dd/mm/yyyy')) )
    and the result is the same.
    If change to
    and (to_char(v.fecha_inicio, 'dd/mm/yyyy')
    between nvl(to_date('01/10/2006', 'dd/mm/yyyy'), to_date('01/01/0001', 'dd/mm/yyyy') )
    and nvl(to_date('31/10/2006', 'dd/mm/yyyy'), to_date('31/12/9999', 'dd/mm/yyyy') ) )
    Sends a not a valid month error but if run the same query on sqldeveloper it works right.
    My question is why I could not get the right data on apex ?
    Thanks you

    I made the changes and is the same thing, no rows returned. If I try to evaluate between or > < is the same.
    I tried
    AND (to_char(v.fecha_inicio, 'yyyy') = '2006' )
    AND (to_char(v.fecha_inicio, 'mm') = '11' )
    And is the only thing I found that works !!!
    So I'm thinking to change my conditions so select a month and year to show. Don't think my user will be happy but for the moment ......
    Thanks

  • HFR - Data Query Optimization Settings

    hi
    In HFR, in a grid there are Data Query Optimization Settings, can you please help me on the settings property.
    Our report fetches data using lot of attributes. When we don't use MDX setting, it fetches very fast, but the alias doesn't come.
    However, when we use MDX setting, the alias comes, but the report takes lot of time to run(approx 1 min / row of data fetched)
    Can you please guide on the same.
    Thanks

    pm wrote:
    Hi ,
    I am working on below query optimization/Tuning.
    SELECT
    c_date,
    c1,
    c2,
    c3,
    c4,
    c5,
    c6
    FROM tab1
    WHERE
    ROWNUM <= &param
    AND ( c_date BETWEEN &date1 AND &date2 )
    AND c3 in (
    select c3
    from tab2
    where xxx='abc')
    ORDER BY c1, c_date;
    Note : &param,&date1 ,&date2 are parameters runtime getting from UI code .
    tab1 having huge data around 10lacs to crores. and it has range partition on c_date column and subpartiotion on c1 column.
    To get best throughput in less time, what i need to do ?
    Please do let me know steps to tune/optimize the sql query.Also which hint we can use on sql query to better results.
    Thanks in advanced.
    PMBefore you start worrying about performance tuning you should worry about the query being incorrect.
             WHERE
                 ROWNUM <= &param
                 AND   ( c_date BETWEEN &date1 AND &date2 )
                 AND c3 in (
                                             select c3
                                             from tab2
                                             where xxx='abc')
             ORDER BY c1, c_date;Presumably you want to limit the number of rows with the ROWNUM predicate AFTER the ORDER BY clause is applied.
    Please read this and learn how queries are actually processed, I can almost guarantee you this query is not doing what you think it is doing at present.
    http://www.oracle.com/technetwork/issue-archive/2006/06-sep/o56asktom-086197.html
    Cheers,

  • Strange data inserted into table via table trigger

    Hi ,
    There is some strange phenomenon happen occasionally where some tables update records will have a TRIGGER to insert records into a table and once in a while, the record has some strange data inserted which looks like a memory corruption. It is running on 10.2.0.3.
    Does anyone ever encounter this before?
    Strange result:
    PRIM_KEY
    -3.614364951000000000000000000000000E-47
    -3.614364951000000000000000000000000E-47
    Normal result:
    PRIM_KEY
    1137KT
    1137KT
    ana

    Hi,
    What is strange in this? Its not memory corruption. Its just one of the numeric form of representation of number
    -3.614364951000000000000000000000000E-47it means -3.614364951 * 10 to the power of -47.
    Whatever value has been entered into the table depends on your business logic you coded, and user input.
    Regards

  • Date query results

    Hello eveybody.
    Im facing a strange problem.
    I have one table with a date item (fecha) and some numeric items. All the rows in table have the date item correct.
    But if I query
    Select sum(a1), sum(a2), sum(an) from table where fecha > Xfecha it give me one results diferent than if I query
    Select sum(a1), sum(a2), sum(an) from table where fecha between Xfecha and Xfecha2.
    Xfecha = '31-JUL-10' in 1º SELECT
    Xfecha := '01-AUG-10' in 2º select
    Xfecha2 := '31-AUG-10'
    The 1º select command must add the same rows than 2º select.
    Any idea?
    Thanks in advanced and regards everybody.
    Edited by: selezeus on Aug 15, 2010 8:33 PM

    Selezeus,
    Make sure there is no entries after the date 31-Aug-2010 is made. And also try using the TRUNC function in the select queries.
    Select sum(a1), sum(a2), sum(an) from table where trunc(fecha) > Xfecha;
    Select sum(a1), sum(a2), sum(an) from table where trunc(fecha) between Xfecha and Xfecha2;Regards,
    Manu.
    If my response or the response of another was helpful or Correct, please mark it accordingly

  • BETWEEN DATE Query help

    Dear Experts, I am new to PL/SQL and need your expert advice and help on below query,
    SELECT * FROM SCHEMA.TABLE
    WHERE DATETIME BETWEEN (TO_DATE('SYSDATE-1 07:00:01','MM/DD/YYYY, HH24:MI:SS')) AND (TO_DATE('SYSDATE-1 14:59:59','MM/DD/YYYY, HH24:MI:SS'));
    I want to automate above query which will select yesterday data from mentioned starttime (07:00:01) to endtime (14:59:59).
    Please help.
    BR,

    Hi,
    DBA wrote:
    I am using below duration in between to get a complete day duration data (of yesterday),
    DTIME BETWEEN TRUNC(SYSDATE-1) + 0/24 + 1/12/60/60 AND TRUNC(SYSDATE-1) + 23/24 + 1799/12/60/60
    Is it valid for a complete one day duration (of yesterday)?
    Please help in clarifying this confusion.
    Bundle of thanks!If you have to ask, then that means it will be hard to debug and maintain.
    Here's a simpler way to find rows where dttime is after 7:00 AM yesterday, but before 3:00 PM yesterday:
    WHERE     dtime     >  TRUNC (SYSDATE - 1) + ( 7 / 24)
    AND     dtime     <  TRUNC (SYSDATE - 1) + (15 / 24)This will pick rows where dtime is as little as 1 second after 7:00 AM, but not 7:00 AM itself. If you want to include 7:00:00 exactly, change the > to >=.

  • Timeout Short Dump on a Data Query to a blank table.

    Hi,
    My program gives a short dump on quering a blank table. The dump says timeout.
    what could the possible problem be.
    regards,

    Runtime Error          TIME_OUT                                                       
           Occurred on     02/19/2009 at   10:35:35                                                                               
    Time limit exceeded.                                                                               
    What happened?                                                                               
    The program "SAPLE31C" has exceeded the maximum permitted runtime without             
    interruption, and has therefore been terminated.                                                                               
    What can you do?                                                                               
    Print out the error message (using the "Print" function)                              
    and make a note of the actions and input that caused the                              
    error.                                                                               
    To resolve the problem, contact your SAP system administrator.                        
    You can use transaction ST22 (ABAP Dump Analysis) to view and administer              
    termination messages, especially those beyond their normal deletion                  
    date.                                                                               
    Error analysis                                                                               
    After a certain length of time, the program is terminated. In the case                
    of a work area, this means that                                                       
    - endless loops (DO, WHILE, ...),                                                     
    - database accesses producing an excessively large result set,                        
    - database accesses without a suitable index (full table scan)                                                                               
    do not block the processing for too long.                                                                               
    The system profile "rdisp/max_wprun_time" contains the maximum runtime of a
    program. The                                                              
    current setting is 5400 seconds. Once this time limit has been exceeded,   
    the system tries to terminate any SQL statements that are currently        
    being executed and tells the ABAP processor to terminate the current       
    program. Then it waits for a maximum of 60 seconds. If the program is      
    still active, the work process is restarted.                                                                               
    successfully processed, the system gives it another 5400 seconds.          
    Hence the maximum runtime of a program is at least twice the value of      
    the system profile parameter "rdisp/max_wprun_time".                                                                               
    How to correct the error                                                                               
    You should usually execute long-running programs as batch jobs.            
    If this is not possible, increase the system profile parameter             
    "rdisp/max_wprun_time".                                                                               
    Depending on the cause of the error, you may have to take one of the       
    following measures:                                                        
    - Endless loop: Correct program;                                           
    - Dataset resulting from database access is too large:                     
      Instead of "SELECT * ... ENDSELECT", use "SELECT * INTO internal table   
      (for example);                                                           
    - Database has an unsuitable index: Check index generation.                                                                               
    You may able to find an interim solution to the problem                    
    ~~~~~~~
    The line to which it points is a select query on a table that has not records.

  • No data query runs longer time

    I have a table with 50 million records, partitioned based on date.
    if i do the query select * from test where trade_date = '01-mar-2010' brings
    the records in less than a second. works perfect
    but if there is no data for any given date in the table, the query takes more than 1 to 2 minute to completed.
    why the query takes that longer to comes back with NO DATA?
    comments are appreciated..
    note:
    i use 11g.
    statistics are collected.

    hello,
    the trade_date range partitioned..and every day the table will have data exception weekends and holidays..
    PARTITION BY RANGE (transaction_DT)
    PARTITION P001 VALUES LESS THAN (TO_DATE(' 2002-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P002 VALUES LESS THAN (TO_DATE(' 2003-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P003 VALUES LESS THAN (TO_DATE(' 2004-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P004 VALUES LESS THAN (TO_DATE(' 2005-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P005 VALUES LESS THAN (TO_DATE(' 2006-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P006 VALUES LESS THAN (TO_DATE(' 2007-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P007 VALUES LESS THAN (TO_DATE(' 2008-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P008 VALUES LESS THAN (TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P009 VALUES LESS THAN (TO_DATE(' 2010-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P010 VALUES LESS THAN (TO_DATE(' 2011-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P011 VALUES LESS THAN (TO_DATE(' 2012-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P012 VALUES LESS THAN (TO_DATE(' 2013-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P013 VALUES LESS THAN (TO_DATE(' 2014-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P014 VALUES LESS THAN (TO_DATE(' 2015-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P015 VALUES LESS THAN (TO_DATE(' 2016-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P016 VALUES LESS THAN (TO_DATE(' 2017-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P017 VALUES LESS THAN (TO_DATE(' 2018-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P018 VALUES LESS THAN (TO_DATE(' 2019-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P019 VALUES LESS THAN (TO_DATE(' 2020-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P020 VALUES LESS THAN (TO_DATE(' 2021-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P021 VALUES LESS THAN (TO_DATE(' 2022-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P022 VALUES LESS THAN (TO_DATE(' 2023-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P023 VALUES LESS THAN (TO_DATE(' 2024-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P024 VALUES LESS THAN (TO_DATE(' 2025-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P025 VALUES LESS THAN (TO_DATE(' 9999-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    Edited by: user520824 on Sep 1, 2010 12:12 PM

Maybe you are looking for

  • Questions about Using Vector To File And JTable

    hi all I want to write all data from Vector To File and read from file To Vector And I want To show all data from vector to JTable Note: I'm using the JBuilder Compiler This is Class A that my datamember  And Methods in it import java.io.*; * <p>Titl

  • A site downloads an old version of SW Player even though I have the newest version installed

    Over the years I've played games at a site (Garfield Games).  The last few years, whenever I update to the new version of Shockwave Player, Garfield Games downloads an old version of SW Player (10.4 to be exact) citing compatibility issues when I try

  • CREATING A SEARCH IN JAVA USING MYSQL QUERY

    How do i create a seach in java using mysql queries. The search need to be like a good type one, whereby a category is typed and the results obtained via the search system using jtable. Thank you.

  • Requesting an overview of how to call a Java program from EBS.

    Hi, I am an experienced Java developer in the middle of an implementation of EBS 12g. I am very new to EBS and I'm not sure where to start on this. I need to provide users the ability to call a Java program that prints a report from EBS. I would be g

  • Trouble powerline fonts sometimes working, but mostly not.

    I'm having trouble with Inconsolata-dz for Powerline rendering the powerline arrows properly with dzen and urxvt.  Terminator and Chromium render the powerline arrows just fine by default though, and Firefox works after selecting the Inconsolata-dz f