Recordset and Dates

Hi, Am trying to use the recordset object but dates are giving me a problem. What kind of format is accepted by the recordset object. Is there a particular format that i should use?.

Hello,
for datasource the format is yyyymmdd  (today would be 20050809)
I guess recordset is the same

Similar Messages

  • Access and Dates

    Hi all I am having trouble retreiving data from an access dataabse and displaying the result in a jTextArea.
    1) The first problem that I encounter is that I want to query on a specific date. Yet due my date being a string in my code and a date/time in access in gives me a type mismatch error? How do I resolve this?
    2) The next error might be due to the above error. When I run the query without the date parameter it only displays the last line of my recordset and I cant figure out why!
    heres the code
    public void getDate()
        SimpleTimeZone tz = new SimpleTimeZone(0 * 60 * 60 * 1000, "GMT");
        tz.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
        tz.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
        SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
        formatter.setTimeZone(tz);
        date = formatter.format(new Date());
        dateLabel.setText(date);
        getCurrentLeaders();
        this.getContentPane().add(jTextArea1,  new XYConstraints(15, 41, 312, 201));
        this.getContentPane().add(jButton2,   new XYConstraints(234, 253, 94, 22));
        this.getContentPane().add(jButton1, new XYConstraints(139, 253, 94, 22));
        getCurrentLeaders();
      public void getCurrentLeaders()
        String query = "SELECT Date,PayNo,Full_Name,DeptNo,Current_Points FROM qryDailyLeagueTable";
    /* I had this line here: WHERE Date  = '" + date+ "'"
    date is set above, yet this cause an error*/
        try
          results = statement.executeQuery(query);
          while (results.next())
            String payNo = results.getString("PayNo");
            String Full_Name = results.getString("Full_Name");
            String DeptNo = results.getString("DeptNo");
            int Current_Points = results.getInt("Current_Points");
            jTextArea1.append("\n" + payNo + "\t" + Full_Name+ "\t " + DeptNo + "\t" + Current_Points);
        catch (SQLException e)
          e.printStackTrace();
      }Please please help as I am really stuck!
    Thanks in advance,
    Z.

    Your Access column should be a Date/Time type.
    You should use PreparedStatement and its setDate method - that's the only DB-independent way to escape Dates properly:
    Your code is awful for a few other reasons, though.
    You've got database and UI code mingled together. Ever heard of MVC separation? There's no sensible reason to do this.
    Looks like you're declaring connection, statement and results as data members. Better to have them as local variables.
    You don't close your statement or result set when you're done with them. That's trouble, especially with Access. It might work out for a query, but the moment you try to do an INSERT/UPDATE/DELETE you'll be another person posting about how your changes don't "stick" in Access.
    You have a column named "Date" in your table? Not only is it unclear, but it's asking for trouble. Making keywords table or column names are sure to confuse the parser and any programmer who might read your code later.
    I'd write it like this:
    // static - no need to evaluate more than once
    // Note column name change
    private static final String SELECT_LEADERS
    = "SELECT  "
    + "ChangeDate,PayNo,Full_Name,DeptNo,Current_Points "
    + "FROM qryDailyLeagueTable "
    + "WHERE ChangeDate  = ?";
    public List getCurrentLeaders(Connection connection, Date thisDate) throws SQLException
        List currentLeaders = new ArrayList();
        Statement statement = null;
         ResultSet rs = null;
         try
               statement = connection.prepareStatement(SELECT_LEADERS);
               statement.setDate(1, thisDate);
               results = statement.executeQuery();
               while (results.next())
                  String payNo = results.getString("PayNo");
                  String fullName = results.getString("Full_Name");
                  String deptNo = results.getString("DeptNo");
                  int currentPoints = results.getInt("Current_Points");
                   // Note: you'll have to write this class
                   Leader leader = new Leader(payNo, fullName, deptNo, currentPoints);
                   currentLeaders.add(leader);  
         // No need to catch - you weren't doing anything with a SQLException, anyway. 
         // Let the calling class deal with it.
         finally
               try { if (rs != null) rs.close(); } catch (SQLException e) {}
               try { if (statement != null) statement.close(); } catch (SQLException e) {}
          return currentLeaders;
    }Now have your UI call this method, get the List of leaders, and then display it. The UI shouldn't have any database code in it, and the data access classes shouldn't have any UI in them.
    %

  • Create recordset join, date = todays date

    hi,
    i have been trying to create a recordset on my page which joins my clients table to insurance table which is fine.
    however i need to be able to show on my page due date = today's date.
    so in my insurance table i have a duedate column with data type DATE
    i need my recordset query to return duedate=todays date and also show if passed due date?
    can anyone help me write this query?
    many thanks

    thanks bregent, the database was helped setup viaa posts on mysql forum and by my understanding of mysql of learning over past year or so.
    i have queried using just a simple join statement.
    thanks
    Date: Mon, 22 Mar 2010 19:36:01 -0600
    From: [email protected]
    To:
    Subject: Dreamweaver Application Development create recordset join, date = todays date
    >How can i do a  query of all duedates in all tables i
    >need to query? is it seperate  recordsets?
    To query against more than one table using standard SQL you could use a UNION query. MySQL also has functionality to query against multiple tables but I don't use MySQL. But I need to ask why you are storing these due dates in more than one table? Who designed this database?
    >also  need to display the ones due the week leading up to due date?
    >so 7 days  before currendate=duedate and also once it passes that i
    >need another  recordset that displays all the ones that have passed
    >currentdate=duedate.
    This is all just simple date math. Please use the reference I gave earlier for examples or search the web for MySQL date math.
    >

  • DSO - What key fields and data fields in dso

    Hi experts,
    I need to create a dso in between the cube and 2 data sources(2lis_11_vaitm, 2lis_12_vcscl) to stage the data. My question is: what key fields and data fields to choose for the dso? is there a standard dso to copy? please explain in detail the model to set up, whether to connect both the ds's to dso and then to cube or one ds to dso and the other to the cube. more details will help.

    Check this for standard DSO:
    http://help.sap.com/saphelp_nw04/helpdata/en/43/fcdc387f34384f94c3227baf3837a8/content.htm
    Thanks...
    Shambhu

  • Reading MS Project column names and data on the fly from a selected View

    Hi guys,
    I have several views on my project file (MSPROJECT 2010) and I want to build a macro so that;
    1. User can select any view ( Views can have diffrent columns and the user may add new columns as well)
    2. User runs the Macro and all the coulmns along with the tasks displayed in the view will be written to a excel file. ( I don't want to build several macro's for each view, I'm thinking of a common method which would work for any selected view)
    The problem I'm facing is that how will i read the column names and data for a particular view on the fly without hard coding them inside the vba code ?
    The solution needs to work on a master schedule as well.
    Appreciate your feedback.

    Just to get you started the following code writes the field name and data for the active task to the Immediate window.
    Sub CopyData()
    Dim fld As TableField
    For Each fld In ActiveProject.TaskTables(ActiveProject.CurrentTable).TableFields
    If fld.Field >= 0 Then
    Debug.Print Application.FieldConstantToFieldName(fld.Field), ActiveCell.Task.GetField(fld.Field)
    End If
    Next fld
    End Sub
    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

  • Pdf portfolio source file name and date in file details

    Is it possible to import the source file name and extension as well as the source file created date in the portfolio file details?  Need to document source to portfolio in working with 3rd parties that will only have the original source.  Need to document what was converted into pdf as not all files in a directory will successfully convert to pdf.  Sometimes need to convert 100's of files.  Manual entry is inefficient.  the file names and modified dates are displayed on the Combine Files dialog.  is there a way to capture the detail on that page?

    I don't need the detail of when the pdf was added to the portfolio.  I
    need know which dwg or jpg or word file was converted and the original
    created date of that file for control of information.
    That is impossible; sorry. For some *very specific* types of conversion to PDF the pdfx:SourceModified XMP tag will be set to show the last-modification date of the source file (for example DOCX files converted using MS Word), but there will never be a human-readable record of the source filename or its creation date unless you have manually added them as document XMP properties after conversion (this is what the "Custom Properties" dialog is for). To embed source data automatically would raise no end of privacy and security problems for customers, who most certainly do NOT want their recipients seeing details of internal documents.
    Without writing a plugin there's no access to the internal workflow of the Combine Files dialog, so you cannot use a script to read the names and dates of the files *before* conversion and store them automatically in the new PDF Portfolio's Fields array.

  • Who worked with ICS' Model 4896 GPIB? I can not count the data from the module. Can prompt as it to make. It is desirable with examples (data read-out from the module and data transmission between channels. It is in advance grateful.

    I can not count the data from the module. Can prompt as it to make. It is desirable with examples (data read-out from the module and data transmission between channels. It is in advance grateful.

    Hello. Most of the engineers in developer exchange are more familiar
    with NI products. Contacting ICS for technical support is a better
    course of action.

  • How can we get Dynamic columns and data with RTF Templates in BI Publisher

    How can we get Dynamic columns and data with RTf Templates.
    My requirement is :
    create table xxinv_item_pei_taginfo(item_id number,
    Organization_id number,
    item varchar2(4000),
    record_type varchar2(4000),
    record_value CLOB,
    State varchar2(4000));
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'USES','fever','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'HOW TO USE','one tablet daily','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'SIDE EFFECTS','XYZ','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'DRUG INTERACTION','ABC','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'OVERDOSE','Go and see doctor','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'NOTES','Take after meal','TX');
    select * from xxinv_item_pei_taginfo;
    Item id Org Id Item Record_type Record_value State
    493991     224     1265-D30     USES     fever     TX
    493991     224     1265-D30     HOW TO USE     one tablet daily     TX
    493991     224     1265-D30     SIDE EFFECTS     XYZ     TX
    493991     224     1265-D30     DRUG INTERACTION     ABC     TX
    493991     224     1265-D30     OVERDOSE      Go and see doctor     TX
    493991     224     1265-D30     NOTES     Take after meal     TX
    Above is my data
    I have to fetch the record_type from a lookup where I can have any of the record type, sometime USES, HOW TO USE, SIDE EFFECTS and sometimes some other set of record types
    In my report I have to get these record typpes as field name dynamically whichever is available in that lookup and record values against them.
    its a BI Publisher report.
    please suggest

    if you have data in db then you can create xml with needed structure
    and so you can create bip report
    do you have errors or .... ?

  • Diff B/w ABAP Dictionary and Data Dictionary

    What is the difference between ABAP Dictionary and Data Dictionary........

    Hi,
    Both are the same.
    Please check this online document perhaps it may help.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCDWBDIC/BCDWBDIC.pdf
    Regards,
    Ferry Lianto

  • ICloud sync and data usage

    After upgrading my ATT iPhone 4 to iOS5, I thought I would try out iCloud. I read somewhere, that it only syncs when it is connected to a powersource, and maybe I read that wrong, but I interpret it to mean when I am connected to either a power outlet or my computer using the cable. In otherwords, it wouldn't sync while I was out and about, away from my wireless home network, using the 3G network.
    Is this not correct?
    Because 2 days ago I racked up 80 MB of my data plan (not iCloud storage) while I slept at home, where I have a wireless network. I found this out by getting a text warning from ATT the next day, that I was close to using up my alloted 200MB data usage. I checked out my account online, and sure enough the 80MB transferred in the middle of the night. I didn't notice the "documents and data" setting was turned on so it looks like my apps updated while my phone was in sleep mode. Is there anything else it could be? I have everything iCloud turned off now and wondering if there is something I should know about to avoid wasting my data usage?

    elko wrote:
    After upgrading my ATT iPhone 4 to iOS5, I thought I would try out iCloud. I read somewhere, that it only syncs when it is connected to a powersource, and maybe I read that wrong, but I interpret it to mean when I am connected to either a power outlet or my computer using the cable. In otherwords, it wouldn't sync while I was out and about, away from my wireless home network, using the 3G network.
    Is this not correct?
    Because 2 days ago I racked up 80 MB of my data plan (not iCloud storage) while I slept at home, where I have a wireless network. I found this out by getting a text warning from ATT the next day, that I was close to using up my alloted 200MB data usage. I checked out my account online, and sure enough the 80MB transferred in the middle of the night. I didn't notice the "documents and data" setting was turned on so it looks like my apps updated while my phone was in sleep mode. Is there anything else it could be? I have everything iCloud turned off now and wondering if there is something I should know about to avoid wasting my data usage?
    I think possibly you are thinking about wireless sync of iTunes. That can be set to happen when you connect to a charger etc, but that is not the same thing as you are descrbing with iCloud.

  • Loading MS Access Table and Data into Oracle

    Hi,
    I have few tables in MS Access. I want to create same layout of tables in Oracle and want to populate data from MS Access tables to Oracle tables.
    Please let me know if there is a way by which I can create tables and load data automatically (thru some option or script)?
    I have Oracle 10g database and its clients.
    Thanks in advance,
    Rajeev.

    You can use Oracle migration workbench
    Loading MS Access Table and Data into Oracle
    It´s very easy to use and good to import
    regards,
    Felipe

  • Question regarding roaming and data usage

    I am currently out of my main country of service, and as such I have a question regarding roaming and data usage.
    I am told that the airplane mode is sufficient from keeping the phone off from roaming, but does this apply to any background data usage for applications and such?
    If the phone is in airplane mode, are all use of the phone including wifi and application use through the wifi outside of all extra charges from roaming?

    Ann154 wrote:
    If you are getting charged to use the wifi, then it is possible.  Otherwise no
    Just to elaborate here, Ann154 is referring to access charges for wifi, which is nothing to do with Verizon, so if you are using it in a plane, hotel, an internet cafe etc that charges for Wifi rather than being free .   Verizon does not charge you (or indeed know about!) wifi usage, or any other usage that is not on their cellular network (such as using a foreign SIM for example in global phones)  So these charges, if any, will not show up on the verizon bill app.  Having it in airplane mode prevents all cellular data traffic so you should be fine

  • Infoset Join condition on Key feilds and data fields

    Hi Guys,
    I have a requirement to biuld the Info set with join conditon on two DSO's  the info objects which i am using in the JOin condition are defined as data fieds in one DSO and defined as key fields in another DSO, is it possible to define join condition on key fields and data fields.
    The two info objects are                
                           0AC_DOC_NO
                           0ITEM_NUM
    These two info objects are defined as  data fields in DSO :   0LIV_DS1   Invocie verificaion
                                                            key fields in DSO:    0FIAP_0o3 FI AP Line Item
    Please suggest me is it possible to define join the condtion on the data fields and key feilds.
    Thanks
    Best regards
    SG

    Hi
    yes you can create join, you will get any issue in reporting level.
    example: Say i want to create Info Set on 0MATERIAL and Sales DSO.
    In 0MATERIAL Info Object it is key filed, but in my DSO 0MATERIAL is data field.Still we can create
    Creation of join is dependent on fields common in your source objects.
    check out the below document
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2f5aa43f-0c01-0010-a990-9641d3d4eef7?QuickLink=index&overridelayout=true
    Regards,
    Venkatesh
    Edited by: Venkateswarlu Nandimandalam on Sep 27, 2011 2:26 AM

  • Key fields and data fields in a DSO  ??

    i have a question regarding key fields and data fields in a Standard DSO...
    i am using 2 datasources to build a open sales report 2LIS_11_VASTH  and  2LIS_11_VASTI   i am pulling in data from these 2 data sources to a DSO and i am wondering what infoobjects should be in the key fields and data fields .....does this reflect back to table VBUK and VBUP tables and does the key field in the DSO have to be the key fields in VBUK and VBUP tables  ????  or what really should be included as key fields and data fields   ????  
    please help....

    If you look at the various SD tables, VBELN and POSNR are commonly used as the document number and document line item.
    For VBAP and VBUP, it's referring to the Sales Order Line Item with the columns VBELN and POSNR as the key for both tables. However, if you look at the LIPS table, which is the Delivery Line Item table, it too has VBELN and POSNR as the key. Likewise, the VTTP table, which is the Shipment Line Item table, also has VBELN and POSNR as the key.
    While using RSOSFIELDMAP as a map is a fairly good "rule of thumb", it still needs to be used with a level of skepticism.

  • Prerequsites for deciding Key fields and data fields

    Hi
    I would like to know the criteria to decide upon KEY fields and Data fields for an infoprovider.

    Hi,
    What is a Key field in a Database and How should I choose one?
    Keys are crucial to a table structure for many reasons, some of which are identified below:
    They ensure that each record in a table is precisely identified.
    They help establish and enforce various types of integrity.
    They serve to establish table relationships.
    Datafields may be Charecteristics and it may be keyfigures
    Regards,
    Marasa.

Maybe you are looking for

  • Clean install on ext hard drive

    I have a new 21" iMac arriving and plan on using external drives rather than the internal one. It's my first time installing OS X from the App Store to a new hard drive so I want to make sure I have the procedure correct. From what I've read I can bo

  • Ken Burns:  wavy line issue during zoom

    As a photographer I work exclusively with stills. Regardless of resoultion/format, images with a full-range K.Burns zoom have undulating, wavy lines. This is especially noticeable in compositions with parallel lines, and further intensified by zoom d

  • Mac Mail is displaying strange characters

    My Mac Mail is displaying these strange characters on a number of seemingly random emails from people. However, when I copy the message and paste it into a word document or the internet browser address bar it converts these "letter A in a box" charac

  • Appinfo node causes ORA-22814

    Hi All, I've got an error ORA-22814: attribute or element value is larger than specified in type ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 0 ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 26 ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 131 ORA-06512: at "XD

  • Sim tray not opening

    Hi, i bought Iphone 4 from carrier and I found the sim tray can't get out I tried many times but same thing, then i went to carrier they told me this is out of warranty because sim tray corners little damage because I tried to pull it out  can apple