Formatting date Problem

Dear All
i am trying to do the following
public Date getHireDate() {  
return Formatter((Date) getAttributeInternal(xdate));
public Date Formatter (Date Mydate){
SimpleDateFormat Format1 = new SimpleDateFormat("MM-yyyy");
Date FinalDate = new Date (Format1.format(Mydate));
System.out.println(FinalDate);
return FinalDate;
but no effect happens, However it exist in getAttributeInternal (VO) when i open the the block and execute query, any way : how to make my format method effect on data coming from db and starting when data coming from db.
Please Advise

Hi,
When constructing a oracle.jbo.domain.Date from a String date value, the string date must be in complete ISO8601 date format. That is "YYYY-MM-DD". So, 1) change the SimpleDateFormat() format to "yyyy-MM" and 2) add "-01" (the first of the month)
Below is the Formatter() as it should be written:
public Date Formatter(Date Mydate) {
SimpleDateFormat Format1 = new SimpleDateFormat("yyyy-MM");
String strDate = Format1.format(Mydate.getValue()) + "-01";
Date FinalDate = new Date(strDate);
System.out.println(FinalDate);
return FinalDate;
Cheers,
Nick

Similar Messages

  • Problem formatting date.

    I have a problem in validating and formatting date input by the user. The user input format is dd-MM-yyyy. I have to validate it and format it to dd-MMM-yy format. I tried the below code.
    import java.util.*;
    import java.text.*;
    public class DateFormatter{
         public static void main(String[] args){
              String str = "24-12-20gg";
              SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
              try{
                   sdf.setLenient(false);
                   Date date = sdf.parse(str);
                   System.out.println(date);
              }catch(Exception e){
                   System.out.println(e);
    The above code parses the date as - Tue Dec 24 00:00:00 IST 0020 . I want to throw an exception if it is not a date and is not of four digits. Any solution ?.

    Why not Java support such things. This will help to avoid reinventing the
    wheel.Java does support such things; there is no need to reinvent the wheel. Example:
    import java.text.*;
    import java.util.*;
    public class DateParseDemo {
        public static void main(String[] args) {
            new DateParseDemo().go();
        public void go() {
            String format = "dd-MM-yyyy";
            String goodDate = "24-12-2003";
            String badDate = "Dec 24, 2004";
            if (dateIsValid(format, goodDate)) {
                System.out.println("\"" + goodDate + "\" is valid!");
            if (!dateIsValid(format, badDate)) {
                System.out.println("\"" + badDate + "\" is NOT valid!");
        public boolean dateIsValid(String format, String date) {
            boolean valid = false;
            DateFormat df = new SimpleDateFormat(format);
            Date parsed;
            try {
                parsed = df.parse(date);
                valid = true;
            } catch (ParseException pe) {
                // log exception
            return valid;

  • Data format inconsistency problem on Discoverer 4i plus and Desktop 4.1

    I encountered 'data format inconsistency' problem when using
    Discoverer 4i plus web version vs Desktop version 4.1 to run the
    same report :-
    The result returned by Desktop version is as following:-
    Employee Count Percent Employee Count
    Mgt 202 18%
    Occ 891 81%
    Other 1 0%
    Percent 1094 100%
    The result returned by 4i web version is like the following:-
    Employee Count Percent Employee Count
    Mgt 202 18%
    Occ 891 81%
    Other 1 0%
    Percent 109400% 100%
    Pls note that the Employee count column is 1094 in Desktop
    version whereas in web version it's 109400%
    After I export the data to Ms Excel, I obtained below result :-
    Employee Count Percent Employee Count
    Mgt 202 0.184644
    Occ 891 0.814442
    Other 1 0.000914
    Percent 1094 1
    I would like to know if this is Oracle Discoverer bug or it's a
    known issues ?
    Pls advise.
    Thanks in advance.

    Hi Discoverer Technical Team,
    Could u pls response to that issue ?
    Thanks and regards.

  • Help needed with missing data problem in CRVS2010

    We recently upgraded the reporting engine in our product to use Crystal Reports for Visual Studio 2010 (previously engine was CR9). Our quote report, which has numerous subreports and lots of conditional formatting, started losing data when a quote took more than a single page to be printed. We knew the SQL results included the data, but the report was not printing those lines at all or sometimes printing a partial line. In addition, the running total on the report would exclude the lines that were being missed on the next page. In one example submitted by a customer, 3 lines were skipped between pages.
    I think I have identified two potential issues that document the possibility of data not being included in the report.
    The first potential issue is an issue with the "suppress blank section" option being checked. This issue is supposedly fixed with ADAPT01483793, being released someday with service pack 2 for CRVS2010.
    The second potential issue is using shared variables. This issue is supposedly fixed with ADAPT01484308, also targeted for SP2.
    Our quote report does not explicitly use shared variables with any of the subreports, but it does have several subreports, each in its own section that has the "supress blank section" option checked. We have other reports that use this feature, as well, and they are not exhibiting the problem.
    One different thing about the quote report is that it has a section with multiple suppression options selected. The section has a conditional suppression formula, which controls whether the section is included at all within the report. The section also has the suppress blank section option selected. There are multiple fields within the report that are each conditionally suppressed. In theory, the section's suppress formula could evaluate to true, yet all of the fields within the section are suppressed (due to null values), and then the "suppress blank section" option would kick in.
    The missing data only seems to happen when the section is not being suppressed, and at least one of the fields is being included in the report. If I clear the "suppress blank section" check box, and change the section formula to also include the rules applied to the fields in the section, the missing data problem seems to be resolved.
    Is this related to ADAPT01483793? Will it be fixed in service pack 2?
    If more details are needed, I would be happy to provide a sample report with stored data.

    Hi Don,
    Have a look at the Record Selection formula in CR Designer ( stand alone ) and when exported to RPT format opening that report in the Designer also. 
    There's been a few issues with => logic in the record selection formula. It could be you are running into this problem. Look for NOT inserted into your selection formula.
    Oh and SP2 is coming out shortly so it may resolve the issue. But if you want you could purchase a support, or if you have a support contract then create a case in SMP and get a rep to work with you to debug the issue.
    If you have not try the Trial Version of CR 2011, put it on a VM-ware image or Test PC so you don't corrupt anything for production and have a look at and test it in that designer also. If you purchase a case and it is a bug then you'll get a credit back for the case.
    Don
    Edited by: Don Williams on Oct 26, 2011 7:40 AM

  • How to print formatted data / report on user's printer in Web Application

    Hi All
    I want to print some formatted data/report ( it might be 1000 pages) on user's printer.
    application is web based and tech. used are Java - jsp - servlets
    now prob. is ...
    how i will transfer all data to client (web browser) from the server and how i can print that data on user's printer ...??
    there is requirement that I can not use applet for this purpose.
    if any one done or have idea then let me know.
    thanks
    Shailesh Koradiya

    Hi
    Its simple, first of all break ur data in terms of pages. Write the logic in one JSP.
    suppose i have jsp PrintReport.jsp , for page 1 url will PrintReport.jsp?page=0 ... so on
    get the page parameter in JSP
    String page="";
    if(request.getParameter("page")!=null)
    page=request.getParameter("page");
    get the rowcount from the Result and assume records per page is 100
    if u have 1000 rows then 10 pages u have to serve
    StartRowNumber=page*recordsPerPage
    EndRowNumber=StartRowNumber+recordsPerPage
    Execute a SQL query , select * from table where rownum between
    StartRowNumber and EndRowNumber
    Provide google like pageNumbers in ur HTML page
    ie 1 2 3 4 5 6 ..10
    Regarding printing , Create HTML button called 'print' and add Javascript ' window.print()' on clicking it.
    Hope it would solve ur problem
    Cheers
    Rajendra Bandi

  • Error in outputting xml formatted data

    Hello,
    I'm trying to output xml formatted data using apex.
    At about 70% into the formatted output I get this in the browser:
      <descript>punct= & > < /,() &</descript>
      </row>
    - <row The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Only one top level element is allowed in an XML document. Error processing resource 'http://apex.oracle.com/pls/otn/f?p=158...
    <script language="JavaScript1.1" type="text/javascript">
    -^
    m">>
    <DIVI have a 600 row table (dml below) with identical string in each row of the descript column. (I put in some special characters just to push it through the escape function for html. It is displaying the text correctly.)
    The page has one report region (plsql below).
    The page template is stripped down.
    My local results are identical to the otn hosted workspace.
    I did dump the table in xml format and displayed the dump file in browser without a problem, so I'm missing something in the code.
    Thank you.
    Albert
    On OTN webspace, go to http://apex.oracle.com/pls/otn/f?p=15866:1:1291425545573680200:::::
    plsql
    declare
    xdescript varchar2(4000);
        begin
        -- xml preface is in the page template
        -- htp.p('<?xml version="1.0"?>');
        htp.p('<rowset>');
        begin
            for item in
            (select descript,cid from receipts order by cid)
            loop
            htp.p ('<row>');
            xdescript := htf.escape_sc(item.descript);
            htp.p('<cid>' || item.cid || '</cid>');
            htp.p('<descript>'|| xdescript || '</descript>');
            htp.p('</row>');
            end loop;
        end;
        htp.p ('</rowset>');
    end;
    dml
    CREATE TABLE  "RECEIPTS"
       (     "CID" NUMBER,
         "AMOUNT" NUMBER NOT NULL ENABLE,
         "CLEARED" DATE,
         "DESCRIPT" VARCHAR2(80),
         "DATEENTERED" DATE DEFAULT SYSTIMESTAMP,
         "CHECKNBR" NUMBER,
         "CLEARSEQ" NUMBER DEFAULT 0,
          CONSTRAINT "RECEIPTS_PK" PRIMARY KEY ("CID") ENABLE
    CREATE SEQUENCE   "RECEIPTS_SEQ"  MINVALUE 1 MAXVALUE 999999999999999999999999999
    INCREMENT BY 1 START WITH 4319 CACHE 20 NOORDER  NOCYCLE
    CREATE OR REPLACE TRIGGER  "BI_RECEIPTS"
      BEFORE INSERT ON "RECEIPTS"
      FOR EACH ROW
    BEGIN
        SELECT "RECEIPTS_SEQ".NEXTVAL INTO :NEW.CID FROM DUAL;
    END;
    ALTER TRIGGER  "BI_RECEIPTS" ENABLE
    /

    May be it helps you. I use SQL/XML and APEX Application Process to generate XML succesfully
    Here is the result:
    http://htmldb.oracle.com/pls/otn/f?p=9774:101:0:APPLICATION_PROCESS=RSSNEWEVENTS
    and here is the Process Text source:
    declare
    a clob;
    begin
    owa_util.mime_header( ccontent_type => 'text/xml', bclose_header => TRUE, ccharset => 'utf-8');
    htp.prn('<?xml version="1.0" encoding="UTF-8"?>');
    select
    XMLTYPE.getStringVal(
    XMLElement("rss",
    XMLAttributes('2.0' as version),
    XMLElement("channel",
    XMLConcat(
    XMLElement("title",'iActiveLife - novinky'),
    XMLElement("link",'http://www.iactivelife.cz/'),
    XMLElement("description",'iActiveLife - Zajímavý život snadn&#283;ji'),
    XMLElement("language",'cs'),
    XMLElement("pubdate",''),
    XMLAgg(
    XMLElement("item",
    XMLConcat(
    XMLElement("title",event_name),
    XMLElement("link",'http://htmldb.oracle.com/pls/otn/f?p=' || v('APP_ID') || ':37:' || v('SESSION') || '::NO::P37_EVENT_ID:' || event_id),
    XMLElement("description",'')
    ) into a
    from (
    select event_id,event_name,issue_date, last_update_order
    from (
    select events.event_id, events.event_name, events.issue_date, rank () over (order by events.issue_date desc) as last_update_order
    from events
    where exists ( select * from opportunities where events.event_id=opportunities.event_id and opportunities.user_id is not null)
    order by events.issue_date desc)
    where last_update_order<=10
    htp.prn(a);
    end;

  • Issue with format: date dd-MMM-yyyy - First letter lower instead of capital

    Hi colleagues,
    I am facing a problem using: <?format-date:FIELD_NAME;’dd-MMM-yyyy’;'UTC'?> on my RTF template.
    When the report run on English it retrieves: Apr, Jun, ...
    but in French it retrieves: apr, jun.
    The client wants the first letter of the month in capital letter I thought that MMM is the format to manage it...
    I am using XML Publisher with PeopleSoft.
    The template is in French and using bursting I create the report in different language depending on some parameters.
    When I preview the template everything is ok.
    Does anyone knows where is the Abbreviate Name of the Month comes from?
    Thanks in advance,
    Juan Diego

    Hi Juan
    It ought to be returning 'Arv' not 'apr' in French right?
    It might be an issue with the i18n library that is being shipped. I would suggest logging a service request with support for some help.
    Regards
    tim

  • Formatting data in table - jsp & jdbc

    Hey there friends!
    I was having a little problem formatting data and I was looking for help!
    I want to format the data from jdbc as follows on a jsp page
    THIS IS REPORT TO GENERATE
    Name | Worked | Refused | Training | CarryOver
    Jim | 10 | 5 | 2 | 5
    Bob | 20 | 5 | 10 |
    The resultset that I retrieve from my database is like this
    RESULTSET
    ID | Name | Type | Hours | CarryOver
    1 | Jim | Worked | 10 | 5
    1 | Jim | Refused | 5 | 5
    1 | Jim | Training | 10 | 5
    2 | Bob | Worked | 20 | 10
    2 | Bob | Training | 5 | 10
    Can anyone suggest what can be a done here?

    As you have learnt something it is only fair for me for reciprocate.
    The code example I gave you was psuedocode - not real java. You need to add in a couple more things to make it work correctly.
    First we want to create an entry in the hash, iff there is no record already there, otherwise, we want to get the value and add our new value to it (let's say the map is called map):
    String key = record.name + "/" + record.type;  // Using combination string as the key - simplest solution
    Long hours = map.get(key);
    if (hours == null) {
       hours = new Long(record.hours);
    } else {
       hours = new Long(hours.getValue() + record.hours);
    map.put(key, hours);It would be better to use your own class to hold the long value - as this would save all the construction calls.

  • Parsing Date Problem

    I have date problem that I am finding hard to resolve. Please
    suggest me what I could do.
    I want to parse String Date values of formats like "19 Jun 2003" and
    "19/06/2003" to a Date object.
    Can I Do it.
    Thanking in Advance.

    Sure. See SimpleDateFormat#parse.
    Kind regards,
      Levi

  • Week returned by Format Date/time String

    Has anyone tested the Format Date/Time String function with the week formating codes?
    I want to create a subfolder for each week and name the folder accordingly. For 17 December 2003 the week is 51 in the year 03 but I get week 50. For 29 December 2003 the week is 01 in the year 04 but I get week 52. For 01 January 2004 the week is 01 in the year 04 but I get week 00. For 29 December 2004 the week is 53 in the year 04 but I get week 52. For 01 January 2005 the week is 53 in the year 04 but I get week 00. There is no difference using %U or %W as code (this will be if 1 January will fall on Sunday or Monday which it does not in my examples).
    I know normally a year has weeks 1 to 52 but in some years the last week may have week
    53 as in 2004. Adding 1 to the week does not solve the problem. For 29 December 2003 it would give 53. And 53 maybe a correct week as in 2004. For 1 January 2005 it would give 1 but the week is the week in the year before.
    All the week numbering I expect is correct for Germany but the function is not. Is the numbering from the function correct for your country?
    Please reply where you are located and if the function will work right for you.
    Waldemar
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

    I have found two resources about date and time and their formats.
    One is the ISO Standard 8601, the second is a german page. On this page along with other information all definitions used by Windows is listed.
    According to this page the ISO Standard has been established in Europe and most industrial countries. In USA it is ANSI X3.30-1985(R1991) and NIST FIPS 4-1.
    Since the ANSI definition you mentioned allows only Sunday (Jewish) or Monday (Christian) as first day of the week it ignores the Islamic world. For them the first day is Saturday. I could not gather information about Buddhistic or Hinduism
    based countries.
    For my application and the market aimed the ISO format is the one which will be choosen. Using %W and handling of week 0 should do it.
    Waldemar
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • [JHS10.1.3] Date problem

    Running into a date problem for a forms migration.
    I have a date field in the database, normal date field.
    The users want to be able to search on partial dates.
    So adding a between on this field will only generate two date selectors, which is not what they want.
    The format is like a year field, week field, day field.
    I could modify the query to return three extra numeric fields which convert the date to the right format ('yyyy', 'wi', 'dd' ) and then to number and generatie 3 between fields for this.
    This will generate the right layout, 6 input fields for a year from/to week from/to day from/to
    But the query will be like (year between x and x) and (week between x and x) and day (between x and x)
    This will not produce the right results.
    What is possible is a string manipulation of the whereclase in the method getViewCriteriaClause()
    And see if any/all of the fields are filled and build the query there, but this is not a 'clean' solution.
    Any idea on how I can solve this? Basicly a date field in the database, user wants to search that date field on year/week/day between year/week/day or a partial of that.
    This is the way it used to be in the forms application so I really want to give the same functionality with ADF.
    Anton

    Not sure if I completely understand what you said, but this is what I did ( it seems to work )
    All my viewobjects extends a new superviewobjectimp, this class has just 2 setters and getters, one for the datefield I want to search on and one for the partial name I gave the three attributes (<fixed name>Year <fixed name>Week <fixed name>Day).
    In the advancedSearch, in the loop trough the attributes I cast the viewobject to this superviewobjectimp. I can now check if the attribute contains the partial name. If this is the case I build my own string and add it to the viewCriteriaMap.
    One odd thing I found here is that it refuses to let me add a string like
    between to_date( '<startdate>', 'yyyy-mm-dd' ) and to_date( '<enddate>', 'yyyy-mm-dd' )Because if I do this, for some reason the attribute name will be wrapped in a to_char!
    If I just leave:
    between '<startdate>' and '<enddate>'It works, but I dont feel really safe about that, I would rather use the datecast to be sure.
    Any idea how this can be done?
    I also used the java Calendar class to transform a yyyy-iw-d to a yyyy-mm-dd because it seems I cant use 'iw' in a to_date(....). This also solved a problem with partial dates, java will autocomplete them for me.
    In other words if I only supply the year 2005 to 2006 it will auto search from 2005-1-1 - 2006-1-1, same for weeks.
    I have a lot of viewobjects which will require this, I'm trying to make it as solid as I can.
    Any suggestions?
    Anton

  • Locale for Date Problem.

    Hi all,
    I am using following code:
    SimpleDateFormat sdf=new SimpleDateFormat("dd/MM/yyyy hh:mm aa");
    Date date=new Date();
    String ls_dateTime=sdf.format(date);
    It is working well. My problem is that I want to change Locale for date as Japanese. But I had problem on new SimpleDateFormat("dd/MM/yyyy hh:mm aa");
    This aa is used to tell that am or pm. Probs is there. [am or pm] which is not correctly displayed.Please tell the solution.

    alinux wrote:
    Hi guys.
    I have a table with 100 000 items and it is growing with 50 rows per day. it has a lot of columns and two of them are:
    expiration_date date,
    status varchar2 (1) ---- A- active and N- Non active.
    the expiration_date is a date.
    80% of these have status = 'A' and expiration_date in future.
    the problem is that I need to create a processes that changes the items status from A to N in exact expiration_date.
    exact means: the exact time, or can be 10 minutes or one hour max after that date.
    the expiration date can be put manually somewhere in future. when I reach this date, the item need to have the status changed to N.
    I was thinking to create a job, that runs each minute. and select all items that are in status A and have expiration_date smaller than sysdate.
    my select will be something like.
    select * from my_table where expiration_date < sysdate and status = A for update.
    for this I will create a composite index on (expiration_date and status).
    is there a another solution? can I do something like a 'ticking bomb':) : when expiration_date is updated and set somewhere in future, to set a process that will take care to change the status when that time is reached. doing this I can avoid to scan the index (from the first solution) at every minute.
    I use oracle 10G.
    Thanks in advance.The BEST solution would be to modify the app so it doesn't rely on a "status" that is derived from a date. Why doesn't the app already know this:
    if expiration_date < sysdate
       status is active
    else
       status is non active
    end ifUse of a data element (in this case STATUS) that can be derived from another data element (in this case EXPIRATION_DATE) is a violation of basic data design 101.

  • Help writing HTML formatted data to JEditorPane multiple times

    I have problems writing data to a JEditorPane more than once. The first time, it works, but the 2nd, 3rd, and so on, the data that is displayed is corrupt. This is where I print the data:
                   ResultsDisplay.getEditorKit().createDefaultDocument();
                   ResultsDisplay.setText(inputStore.toString());There seems to be something wrong with the way I display the data. What do I have to do to change HTML formated data that is printed to an JEditorPane?
    This is how I set up the JEditorPane:
         javax.swing.JEditorPane ResultsDisplay = new javax.swing.JEditorPane();
         JScrollPane ResultsDisplayScrollPlane = new JScrollPane(ResultsDisplay);
         HTMLEditorKit htmlEdKit = new HTMLEditorKit();and
              ResultsDisplay.setEditable(false);
              ResultsDisplay.setEditorKit(htmlEdKit);
              ResultsDisplay.setContentType("text/html");
              ResultsDisplay.setEditorKitForContentType("text/html", htmlEdKit);
              getContentPane().add(ResultsDisplayScrollPlane);
              ResultsDisplayScrollPlane.setBounds(50,50,700,450);Am I doing anything wrong here? Why can I only write the data once during the Applet's run life?

    Hi again,
    Does anyone have experience writing to a JEditorPane multiple times during the run-life of a Applet? When I first send the data, it is displayed correctly. But everytime after that, the data is corrupted. My data is written in tables (in HTML format). The second time I write to the JEditorPane, it only displays the first of my tables, and only displays the collumn names and in the last column it displays the first row of data squeezed into the last column name's cell. If I run a third time, it takes this old table and adds a new table from the third run. With the fourth run I end up with 3 tables each containing only one row with the column names and the 1st row of data squeezed into the last collumn name cell.
    Can anyone help? I've already tried creating a new document as described in the JEditorPane's API.

  • Serious date problem

    I am using Form 6i.
    I am getting serious date problem.
    The MM/DD/RRRR is converted to DD/MM/RRRR and the result is false record.
    How to avoid this serious problem. I am very shocked to find this error after few hours of brainstorming session.
    I am using following query to create cursor
    [htm]     CURSOR cur_first IS SELECT      a.item_code,
         b.item_description,
         a.lot_no,
         d.name model,
         c.vendname,
         date_of_purchase,
         warrenty_upto,
         quentaty,
         rate,
         pc_type,
         TO_DATE(decode(warrenty_flag_yn,
                        'W', TO_DATE(warrenty_upto),
                        'A', TO_DATE('31-MAR-'||v_year),
                        'X', TO_DATE('31-MAR-'||v_year)),'DD-MM-RR') AS amc_date
         FROM      pc_item_procurement_history a,
                        pc_item_master b,
                        pc_vendor_master c,
                        pc_model_master d
         WHERE a.item_code= b.item_code
         AND a.modelcode=d.modelcode
         AND a.vendcode=c.vendcode
         AND (b.item_description LIKE '%'||:blk_main.item_name||'%' OR :blk_main.item_name IS NULL)
         AND (TO_DATE(a.warrenty_upto,'DD-MM-RR') <= :blk_main.to_date OR :blk_main.to_date IS NULL)
         AND warrenty_flag_yn='W'
         ORDER BY b.item_description;
    /pre][html]
    Thanks and regards,
    Vikas                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    I've just noticed something in the where clause that makes all this a lot easier.
         CURSOR cur_first IS SELECT      a.item_code,
         b.item_description,
         a.lot_no,
         d.name model,
         c.vendname,
         date_of_purchase,
         warrenty_upto,
         quentaty,
         rate,
         pc_type,
         warrenty_upto AS amc_date
         FROM      pc_item_procurement_history a,
                        pc_item_master b,
                        pc_vendor_master c,
                        pc_model_master d
         WHERE a.item_code= b.item_code
         AND a.modelcode=d.modelcode
         AND a.vendcode=c.vendcode
         AND (b.item_description LIKE '%'||:blk_main.item_name||'%' OR :blk_main.item_name IS NULL)
         AND (a.warrenty_upto <= :blk_main.to_date OR :blk_main.to_date IS NULL)
         AND warrenty_flag_yn='W'
         ORDER BY b.item_description;BUT...
    Is Warrenty_upto really a date column? You say it is "stored as m/d/yyyy" but a date is not stored with a format in oracle - it's just a date and the format is applied when you retrieve the data.
    In sql*plus if you Describe the table you can see the column type. If you select the data you only ever get a string.
    I'm assuming :blk_main.to_date is a date.

  • String to Date problems

    Hi there,
    Problem: a String looks like this: "02.02.2009 02:02:02". Now this string should be transformed into date format.
    Unfortunately we found nothing helpful about this problem. At the moment the code looks like this:
    java.util.Date dDate = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss").parse(dateString);
    SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss",Locale.getDefault());
    //System.out.println(dateString);
    format.format(dDate);
    System.out.println(dDate);This is the result: "Mon Feb 02 02:02:02 CET 2009". But we need this format "02.02.2009 02:02:02" in date format to sort a list.
    Thanks

    This works for me...
    package forums;
    import java.util.Date;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Locale;
    public class DateFormatTest
      private static final Locale DEFAULT_LOCALE = Locale.getDefault();
      private static final String DATE_FORMAT_STRING = "dd.MM.yyyy hh:mm:ss";
      private static final DateFormat DATE_FORMAT = new SimpleDateFormat(DATE_FORMAT_STRING, DEFAULT_LOCALE);
      public static void main(String[] args) {
        System.out.println("DEFAULT_LOCALE="+DEFAULT_LOCALE);
        System.out.println("DATE_FORMAT_STRING="+DATE_FORMAT_STRING);
        final String dateString = "31.12.2009 23:59:59";
        System.out.println("dateString="+dateString);
        try {
          Date date = DATE_FORMAT.parse(dateString);
          System.out.println("date="+date);
          System.out.println("DATE_FORMAT.format(date)="+DATE_FORMAT.format(date));
        } catch (Exception e) {
          e.printStackTrace();
    output
    C:\Java\home\src\forums>"C:\Program Files\Java\jdk1.6.0_12\bin\java.exe" -Xms4m -Xmx256m -enableassertions -cp "C:\Java\home\classes" forums.DateFormatTest
    DEFAULT_LOCALE=en_AU // 12 for 1... There's really no need to giftwrap the urn Winston, thanks anyway.
    DATE_FORMAT_STRING=dd.MM.yyyy hh:mm:ss
    dateString=31.12.2009 23:59:59
    date=Thu Dec 31 23:59:59 EST 2009
    DATE_FORMAT.format(date)=31.12.2009 11:59:59
    Press any key to continue . . .Cheers. Keith.

Maybe you are looking for

  • Three things I would like to see in Flash Catalyst.

    1. I would REALLY like a way to edit the code in Flash Catalyst. If Adobe doesn't figure this one out, they will lose a lot of business. I'm not going to buy an other product like Flex just so I can edit the code. I'm sure I'm not the only one, but o

  • Integration between third party software and SAP

    Hi all, I have requirement in which i have to integrate SAP with third party software. My third party software will be generating material no as we generate in SAP then after the generation of the Material No by the third party software again i have

  • 1 iphone3g, 2 Macs....can I sync music, video, and apps using both machines

    I have a MacBook Pro for work and an iMac at home and would like to be able to add music or movies to my iPhone from either machine. I can do this with no issue with my 80gb Classic but it wants to erase and start over anytime I plug the iPhone in an

  • Making Payments with Payment Cards

    Can anyone provide insight into the SAP configuration and transactions that are needed to make payments using payment cards.  Most documentation I can find relates to receiving payment from customers.  We are investigating options available to make v

  • Problems with installation of eclipse

    When I try to install eclipse on my machine, It says some error and I get the following error message in the log file. SESSION ---------------------------------------------------------------------- !ENTRY org.eclipse.core.launcher 4 0 Nov 18, 2005 15