String to date not converted correctly

Hello,
Why am I getting the following error message when i beleive i have formatted the variable date to be in 'MM/dd/yyyy' format?
Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Err_Date = Sat Dec 12 00:00:00 PST 1998'.
The date should not be in the above format 'Sat Dec 12 00:00:00 PST 1998'.
Here is my code:
<%@page import="java.sql.*"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="java.util.Date"%>
<%
Connection con = null;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection"jdbc:odbc:errorlog", "admin", "");
catch(Exception e){
out.println(e.getMessage());
%>
<%
ResultSet rs=null;
Statement stmt=null;
try {
stmt=con.createStatement();
String start = request.getParameter("From");//TAKEN FROM FORM
String end = request.getParameter("To");//TAKEN FROM FORM
SimpleDateFormat dateFormat = new SimpleDateFormat ("MM/dd/yyyy");
Date date = dateFormat.parse(end);
String sql="DELETE FROM tblError WHERE Err_Date = "+date+"";
rs = stmt.executeQuery(sql);//Err_Date IS A DATE/TIME FIELD
%>
<%
rs.close();
stmt.close();
con.close();
catch (SQLException e) {
out.println(e.getMessage());
%>

I think you need to enclose the date string in single quotes.
E.g., I think you're performing:
DELETE FROM tblError WHERE Err_Date = 04/28/2003
When what you want to perform is:
DELETE FROM tblError WHERE Err_Date = '04/28/2003'

Similar Messages

  • I have canceled my account same day and joining because the convert PDF to word did not convert correctly how to get credit for cancelled membership

    I have canceled my account same day and joining because the convert PDF to word did not convert correctly how to get credit for cancelled membership

    You need to contact Adobe Customer Support :
    They will check and assist you. (Live Chat)
    Contact Customer Care

  • My document did not convert correctly.  Can I fix it in the PDF version?

    My document did not save as it was originally written.  Can I fix it once it has been changed to a PDF?

    Hi iamreadytoscream,
    Did you use PDF Pack to convert a file to PDF? What was the original file format? And, can you provide a little detail about what didn't convert correctly?
    I think the best approach is to figure out why the file didn't convert correctly. You would need Acrobat to edit the PDF once it's created. And, as Acrobat isn't a word processor, it really isn't meant for major editing or formatting.
    Please tell me a bit more about the file that you converted and we'll go from there.
    Best,
    Sara

  • CJK characters are not converted correctly to PDF

    We are developing layout using SMARTFORMS. We are using standard function module 'CONVERT_OTFSPOOLJOB_2_PDF'  to convert the SMARTFORM to PDF. Chinese, Japanese, Korean characters are not displayed/Converted correctly in PDF documents. But in Spool these characters are showing correctly.
    Whereas German, Italian, French are displaying and printing correctly and converting properly to PDF.Please suggest a suitable
    note/correction for the above.

    Hello dear,
    Did you got a solution for this? Even i am facing the smae problem.
    Warm regards,
    Harshad.

  • Date not displaying correctly

    Hi,
    we have an issue where date is not displaying correctly in report. it shows 1/1/1990. even in universe it shows the same value 1/1/1990. but if i run query at DB level it shows the correct date. Reporting Database is Sybase.
    we are on Bi 4.0 SP 6.
    Any Ideas.
    Thanks,
    Yogesh.

    HI Farzana,
    Finally,i have narrowed down the issue. So here it is,Initially we were seeing date as 1/1/1900 in webi rich, IDT and BI LaunchPad. so than we have made changes to sybase. prm file in following location
    ........\dataAccess\connectionServer\sybase\extensions\legacy
    in prm file the input date parameter is as below
    <Parameter Name="USER_INPUT_DATE_FORMAT">'mm/dd/yyyy hh:m:s am/pm'</Parameter>
    we changed it to
    <Parameter Name="USER_INPUT_DATE_FORMAT">'mm/dd/yyyy hh:mm:ss A'</Parameter>
    and than  we see correct date in IDT and Webi rich but not in BI LaunchPad. the connection we were using in universe is ODBC. so i have created a new connection using sybase CTL client and now i see correct dates in BI LaunchPad also. So i am not sure if i need to make changes to prm file in /dataAccess\connectionServer\odbc\extensions location for the report to show correct values using ODBC.
    Any Idea.
    Thanks,
    Kumar.

  • File not converting correctly

    I downloaded a file several time to convert PDF to Excel.  The first line of the file is converted correctly and all subsequent lines are put in column A only and not separating into columns A thru F.

    I got it.....
    Thanks,
    Niki Shah

  • Dates not refreshed correctly

    Hi,
    We are using service contracts BT112H_SC from Web UI. From this component we are calling SAP GUI actions (using transaction launcher) to make changes to the contract u2013 like cancellations, date changes and so on.
    We now have a problem with refreshing the Dates assignment block from service contract. The Dates assignment block is handled within a separate component called BTDATES and is called from BT112H_SC using component usage.
    When running an action that should change the dates (due to for example an Annulation of contract), the status is set to Cancelled but the dates Contract end date is not changed. I am calling function module CRM_ORDER_READ_OW after the action is executed in some places and see that the dates are updated correctly in the buffer, but they are not showing up in the Web UI.
    It seems as the dates are set correctly if I donu2019t expand the assignment block Dates before running the action. So if I expand the assignment block after running the action the dates are set correctly. If expanding the Dates assignment block before running the action, the dates are not updated.
    The dates are also set correctly after saving the contract so it is just a matter of visibility.
    Also if I (after running the action), go to one of the items and expanding the Dates assignment block on item level and then go back to header level the dates are displayed correctly.
    I have enhanced component BTDATES/Dates u2013 Method DO_PREPARE_OUTPUT where I use the following commands that should refresh the values.
    me->typed_context->btdate->collection_wrapper->publish_current( ).
        lr_ent ?= me->typed_context->btdate->collection_wrapper->get_current( ).
        lr_ent->reread( ).
    I have also used the command modify without success.
    Somehow the BTDATES component must be refreshed to read the dates from the buffer correctly after the action is executed.
    Do anyone have any suggestions on how to handle this?
    Regards Andreas

    Hi,
    Thanks a lot for your answers. I need all input I can get.
    Kathirvel: I can see that event 0002_expand_link is triggered (from class  ZL_BT112H_S_MAINWINDOW_IMPL I believe) when expanding the Dates assigment block. But I cannot figure out what is happening next.
    But after expanding the assignment block once, the event is not triggered if I expand/collapse the assigment block again.
    I see that in CL_BSP_WD_VIEW_MANAGER ~ DO_FINISH_INPUT when expanding Date assignment block, a BOL_CORE->MODIFY statement is made. This code is triggered when expanding the Date assignment block (but only first time).
    Do you know which event I could call to trigger the update again?
    asen2222 : I entered the code lr_core->modify( ) in ZL_BT112H_S_OVVIEWSET_IMPL ~ DO_PREPARE_OUTPUT which is called after my action is executed and the dates are modified in the buffer. But it doesn't work. When debugging the modify( ) method it seems as it have no delta-information to save.
    I have also tried setting the statement in component BTDATES - ZL_BTDATES_DATES0_IMPL ~ DO_PREPARE_OUTPUT without success.
    In the same place -  component BTDATES - ZL_BTDATES_DATES0_IMPL ~ DO_PREPARE_OUTPUT  -  I also put the following code:
    lr_ent ?= me->typed_context->btdate->collection_wrapper->get_current( ).lr_ent->reread( ).
    This do not work either. But if I debug the reread method and go into
    method REREAD_ENTITY of CL_CRM_BOL_CORE I see following code:
    lv_relation_cacheable = me->object_model->relation_is_cacheable(
    lv_parent_relation_name ).
    If I then set lv_relation_cacheable = ' ', it seems to bypass the buffer and read the data from underlying layers. And then the values is showingcorrectly updated!.
    I believe it is reading the relation from table CRMC_ORLSTA_BTIL but this
    table do not include field DO_NOT_BUFFER so I assume this field should
    never be set for business transactions. But in this case it wouldhave worked for us.
    Regards Andreas

  • IPhoto Library from 7.1.5 not converted correctly to 9.5, now shows up empty

    Hello all,
    My mother recently aquired a new MacBook Pro; the data from her old laptop was transferred by the company it was bought at. (not a fan of that, but I wasn't around to do that as I live quite far away)
    The previous laptop was running Lion and an old iPhoto (7.1.5), the new one is running Mavericks and iPhoto 9.5. When I opened iPhoto for the first time, it asked whether I wanted to convert the library, to which I replied I didn't at that time - and iPhoto quit as expected. I opened it with the option key pressed, to see whether there were any other libraries to choose from, and upon choosing the only one available, iPhoto simply opened. The problem is: it opened the library without converting it, meaning that I now have a 179GB library which iPhoto says is empty.
    I am aware that all photos are still there, but I would really like my mother not to have to rearrange all those photos by making a new library and moving them over (we're talking tens of thousands of photos).
    I have tried repairing permissions, repairing the database, rebuilding the database (all from the command-option boot of iPhoto) - all of which end up with the same empty library; I have tried the iPhoto Library Upgrader, which simply tells me that the library has already been updated for the current iPhoto version.
    In other words: is there a way to either make iPhoto re-read the contents, or manually convert the library?
    Best regards,
    KB

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In early versions of Library Manager it's the File -> Rebuild command. In later versions it's under the Library menu.)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  
    Regards
    TD

  • Google map data not displaying correctly in a spry collapsible panel

    I created a spry collapsible panel into which I've put google map data. The map placed in the collapsible panel looks and functions OK but shows my location in the wrong place. I tested it by putting exactly the same google map elsewhere on my page and this time it displays my location correctly. Here is a link to my test page: http://www.cornucopia-design.co.uk/BatimTest/map3test.html . Mouse over the 'view our location' link to see the incorrectly located map. It places my location in the top left corner rather than in the centre.  When you click on google's 'view larger map' links, they both then display the location identically. Anyone have any ideas about what's going on here? Is the coding for the collapsible panel doing something to the google code? I'm not a great code expert so any help would be greatly appreciated. Thanks

    Hello, thank you for your helpful comments. At least I now won't waste any more time trying to get this to work if it just won't... I'll just have to display the map in another way.
    Just a point about your suggestion of offsetting - I had thought of that but if I did that, when someone clicked on the map, they would be taken to the wrong place as, as I said, even though it displays incorrectly in my panel, the data IS correct and therefore correctly linked back to google maps.
    Thanks anyway.

  • Endashes and quotes are not converted correctly when copying FM files by reference

    I'm using FM7 in the TCS1 in a Windows XP environment. I am copying FM books by reference into my RH project.
    I'm noticing that endashes (–) and quotation marks (") are not consistently coming across correctly in my RH project.  Instead, I am getting &endash; for the endash, and &rdquor: instead of a quote.  Note: it appears to be only the first quote that encloses text that doesn't convert; the closing quote converts.
    Any ideas?

    I have RoboHelp 7 and the patches won't install unless I do a complete reinstall.  Since I'm at the end of a release, that will have to wait.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Mary K. Greer
    Information Developer - Learning Management Solutions
    Intelligent Automation Solutions Client Services
    407.771.8187

  • Idoc status green but data not posted correctly to destination system.

    Hi,
    Can anyone help me out with idoc problem that I am facing.
    The problem has come out with outbound idoc.
    The status of the idoc is green when it has been sent but the objects that has been sent with that idoc are not getting posted in the destination system.Some of them are posted correctly but some of them are not.
    What may be the reason behind this.
    Regards,
    Rachana.

    Good morning
    What was the resolution here? We are siitng with the same problem, but IDoc's are correct, but data packet not processed.
    Thanks, have  a nice day
    Cj

  • PDF to epub not converting correctly

    After I change my PDF to an epub file, it does not look the same. I have two photos per page in the PDF, and when it converts to epub it shows only one picture per page with double the amount of pages?

    I may become a PITA for you, but I think you need to step back and
    determine how you started this process.....
    .pdf is a file format that's been used for documents for what seems like
    forever.  It has many limitations, and for that reason, other formats for
    epublications were developed.  Those formats permit more flexibility in
    formatting text, illustrations and colors that .pdf does.  Adobe developed
    the 'epublication' format (.epub) many years ago, and it's one of the
    standards in the industry.  There are very few companies that publish
    ebooks that don't have an .epub version available.
    I don't know why you chose .pdf format for the ebooks you downloaded.  The
    results seem unsatisfactory (!).  You say 'the original format doesn't
    work' , but you chose it - perhaps not knowing how limited a .pdf file is,
    and on the faith that the NOOK supports .pdf.  Digital Editions does also,
    but within limitations, because it does not incorporate all of the features
    found in Adobe Reader software (which is designed to handle .pdfs).  So,
    there's no telling whether the ebooks you purchased in .pdf are using
    features not supported by either the NOOK or Digital Editions - until you
    run into a problem.
    This 'feature' problem is compounded by conversions.  You have no idea when
    you start whether the program you're going to use will do the job correctly
    because you don't know what .pdf features are incorporated in the original
    ebook.  Slowly, step by step, we go down the rabbit hole...
    ==================

  • Updating io6 and contacts did not convert correctly

    I upgraded to ios 6 and my contacts did move correctly.

    Contacts do not move or convert.
    Contacts are designed to be synced to a supported application on the computer or a cloud service.
    Sync them back from whatever app or service they were previously synced with.

  • Issues with dates not storing correctly on a data entry screen

    We are using Application Express 3.0.1.00.08
    I have a table which I have written a data entry screen for, the user enters most of the fields on theentry screen, howevere there are some fields that I would like to populate when a biutton is pressed e.g last_updated_date and creation_date.
    I have a on submit after computations and validation process with the following code to set the last updated date:
    begin
    :P1_LAST_UPDATED := to_date(sysdate,'DD-MON-RRRR HH24:MI');
    end;
    I am setting the creation date at the same time as getting the primary key as follows:
    declare
    function get_pk return varchar2
    is
    begin
    for c1 in (select XX_SVS_SEQ.nextval next_val
    from dual)
    loop
    return c1.next_val;
    end loop;
    end;
    begin
    :P1_ID := get_pk;
    :P1_CREATION_DATE := sysdate;
    :P1_CREATED_BY := :F380_OSS_USER_ID;
    end;
    However the dates are being written to the database incorrectly they are being written with a year 0009 instead of 2009.
    Does anyone know how I can get hidden dates in a data entry form to write correctly to the database.
    Regards
    Kay

    It could be done as a database trigger but surely APEX should be capable of saving the correct date format of an item.
    Since my original post I have managed to get the dates stored with the correct year in the hidden fileds by doing the following in my process:
    :P1_LAST_UPDATED := to_date(sysdate,'DD-MON-RRRR HH24:MI');
    however for some reason the date is being stored with the correct year now as 2009 , but the time element is not being stored any ideas?

  • CALENDAR WITH DATES NOT PLACED CORRECTLY

    THE CALENDAR IS NOT SHOWING THE DATES CORRECTLY.  MOUNTAIN LION

    It could be done as a database trigger but surely APEX should be capable of saving the correct date format of an item.
    Since my original post I have managed to get the dates stored with the correct year in the hidden fileds by doing the following in my process:
    :P1_LAST_UPDATED := to_date(sysdate,'DD-MON-RRRR HH24:MI');
    however for some reason the date is being stored with the correct year now as 2009 , but the time element is not being stored any ideas?

Maybe you are looking for

  • Process OB files in order and send idocs in order as well

    Hi. I've placed some files in a folder. With file adapter i want to pick them in order (by name). As result of each file, i get an IDOC posted in SAP. File1.csv, File2.csv, File3.csv and File4.csv. I set EOIO as quaility of service, added a queue nam

  • JVM Using more than -Mx Memmory and RSS

    Hi All, Used -Xms256m -Xmx512m parameters for weblogic Admin server 10.0.1.0, 9.2.2, but the server is using more than the value specified and it is not happening for weblogic version 10.3, This was found while cross checking with ps and prstat. and

  • Event selector missing in Event Structure

    Hi, the event selector in my Event Structure is suddenly missing. How do I get it back? This is how it look in the block diagram: If I copy it and past it in paint I can see the selector.

  • Upload serial numbers for an existing item

    Hi, I'm having some problems trying to upload 880 serial numbers using DTW. Basically, we have created a purchase order for these 880 items under a similar item code. I am managing this item using a serial number on every transaction in SBO. I have b

  • Wild bug on Sun Java System Application Server 9.1 (build b41d-beta2)

    i'am facing a strange problem when i try to deploy any application that utilizes ajax4jsf 1.1.1 also it works fine when i deployed the webapplication on tomcat 6 and on Sun Java System Application Server Platform Edition 9.0_01 (build b02-p01) please