How to combine sql.Date with sql.Time into one?

I have a database where I keep dates and times separately, and getting date only and time only out of a java.util.Date is no problem thanks to the classes java.sql.Date and java.sql.Time. However, I need to read these values back in, put them back together, and then do date comparisons with java.util.GregorianCalendar. I tried just adding the millisecond long values together but that didn't seem to work, and I've tried setting the year, month, date, hours, minutes and seconds individually into a GregorianCalendar but I haven't figured that out yet. Certain queries work out better keeping the date and time separate in the database and it takes less bytes than a timestamp, so please don't suggest I use a timestamp!
Thanks for your help!
Stephen

You can add the milliseconds (ms), but you need to use just part of it. For this example, let X be one more than the maximum number of units in time and also the minimum number of units in date. If we were using hours instead of ms X would be 24.
t = total ms from time
d = total ms from date
T = new combined time
T = ((d / X) * X) + (T % X);Add (the date, rounded to the nearest day) and (the portion of time which is less than a day).

Similar Messages

  • Combine the data of two DSOs into one

    Hello experts,
    how to load the data of two DSOs into a single one using transformations and DTPs?
    Example:
    DSO A keyfields: X,Y,Z / attributes M,N,O
    DSO B keyfields: X,Y,Z / attributes P,Q
    DSO C keyfields: X,Y,Z / attributes M,N,O,P,Q  (result should be a single data record!)
    In the transformation between DSO A and C I map all keyfields and attributes M,N,O (no mapping for P and Q, meaning no transformation rule). For B to C mapping is all keyfields and attributes P, Q (no mapping for M,N,O, no transformation rule).
    When I now load the data of DSO A and DSO B to DSO C I either see the attributes M,N,O or P,Q. This means that only the latest DTP is available and overwrites the attributes with blank values of the first DTP.
    I have a solution using ABAP coding but according to the SAP Training courses (BW330) it should work without using ABAP coding.
    Any help is highly appreciated.
    Thanks in advance.
    Marco

    Hi Marco,
    Thanks again
    I looked into BW330 Business information warehouse - Modelling.
    Course version : 2006 Q2
    Material number : 50079531
    I looked into the page 281 still no luck.
    just an overview i need to create X,Y,Z,M,N,O as info objects characteristics
    and P, O  as infoobjects keyfigure.
    None of them will have attributes and i load XYZMNO to DSO1 and same XYZPO to DSO2.
    Then map DSO1 - DSO3 and  DSO2 - DSO3 and carry out the steps to get the data from DSO1 and DSO2 to DSO3.
    Am i right.
    Regards,
    Harish

  • How to combine images from several different shoots into one

    Have LR 3.6 for Win xp.
    I have 4 differernt photo shoots that I want to combine into one big single catalogue.  I want to be able to rank and choose images from all 4 shoots at the same time so I can get the best ones identified.
    Each shoot is already in its separate catalogue but I cant figure out how to get all 4 shoots to show up at once so I can rank the best shots and maybe even make a collection of my best images from the 4 shoots.
    How might I do this??
    Thanks Suzzie

    My primary suggestion is that you watch the many videos by Julianne Kost provided in the Adobe site about organizing in the Library Module in LR 4, or read one of the many good LR books. If you want to venture on your own here's a very shorthand description of one of many ways to do what you want. Choose which Catalog you want to use. Open that Catalog and choose "Import from Another Catalog" under the File Menu in the Library Module. Select the images and import them to your chosen main catalog. Once all are in the same Catalog either Keyword all similar images you wish to compare, or make separate Collections of each one. Use the Compare function in the Library ("c" key) and eliminate the one you don't want. Unless you have one client viewing your images in LR and you don't want them to see that you have other images for other clients, I would suggest you use only a single catalog from here on out.

  • How to combine Jars or Include dependent Jars into One Jar

    Hello,
    I have build a small utility using few libraries now i want to make a bundle or jar of this utility. I don't want to let use includes the jars individuals. I want to make a single jar using all the jars so user needs to include only one jar.
    So i need to include the dependent Jar files into a single jar.
    I got few solutions using Google.
    Like:
    adding a Class-Path: myjar.jar to MANIFESTfile.
    simply update the jar with jar using commnad jar uf main.jar myjar.jar_
    but these are not working. when i use the Class-Path option the Tree of main jar looks like
    main.jar
        <default-package>
             myjar.jar
        META-INF
             MANIFEST.MF
    How can i combine the Jars into a single Jar? Please help.

    It is to tell the JVM where to look for additional classesDoes it mean if i includes dependent jars to main jar and if i specify the path then JVM find that jars to specified pathThat's what 'telling the JVM where to look for additional classes' means, isn't it? I don't know what else it would mean.
    and don't need to include it separately?You only have to specify the Class-path in the manifest, and run the JAR file with java -jar. In fact if you specify a classpath on the command line with java -jar it will be ignored.
    All this is in the documentation.

  • How to retrieve different data separated by comma into one column

    Hi all,
    We have a Custom View.In that some of the customer's Bill-To address is different remaining all columns contain same data.In that case if we query with that customer_number it displays more than one row with different Bill-to addresses,it is fine.But our requirement is we need to display only one row for that customer_number and Bill-to address column shows all Bill-to addresses corresponding to that customer separated by comma.
    Could anyone give us any idea to solve this.
    Thanks in Advance,
    Dhana

    i do not a concatenated data
    i have a data in a table with columns A & B of same size
    A B
    1 2
    2
    3 1
    4 2
    5 3
    6 5
    7 1
    8 4
    9
    10 8
    if my where condition is 'where A=2'
    my output should be
    1
    2
    3
    4
    5
    6
    8
    10
    i want my query to search as loop so that it keeps on searching
    for related data as in my case it is
    2 is linked to 1
    1 is linked to 3
    3 is linked to 4
    my query should keep on seaching for linked numbers till
    it does not find any mathing linked numbers
    and the resulted output should come in one single column

  • How can i browse data in my time capsule with my iPhone?

    how can i browse data in my time capsule with my iPhone?

    You might want to take a look at FileBrowser.
    App Store - FileBrowser - Access files on remote computers

  • How to validate a date with time

    Hi All,
    How can I validate date with time?
    Here is my code:
    var tempDate:Date = new Date();
    if (tempDate < '09/18/2012 7:30:00 AM'){
         doSomething
    Thanks in advanced

    I think i got it to work.
    var tempDate:Date = new Date();
    var oldDate:Date = new Date('09/18/2012 7:30:00 AM');
    if ( Number(tempDate) < Number(oldDate) ){
         doSomething
    Best,

  • How to combine a bar with a line in a chart

    Post Author: rbcdexia
    CA Forum: Charts and Graphs
    We want to combine data in bars and with a line showing in one chart.
    Is that possible? How do you configure your chart?
    The line and the bars are based on the values from different fields in the same table.

    Post Author: pareshb
    CA Forum: Charts and Graphs
    We are using Crystal Reports for Visual Studio 2005. Can you please let me know how to combine a bar with a line chart.
    Thanks in advance.Paresh

  • How to Sync System Clock with Internet Time in Windows 7?

    "Internet Time" tab is missing in Clock Settings as shown in below link.
    http://mintywhite.com/windows-7/7maintenance/windows-seven-7-sync-system-clock-with-internet-time-how-to/
    Please suggest how to Sync System Clock with Internet Time in Windows 7?
    Regards, Dharmendra, Bangalore (India)

    The note at the bottom of the first link from Alex Verboon has the following, which worked on my Domain-associated Windows 7 system:
    Synchronizing with an Internet time server
    You can synchronize your computer clock with an Internet time server. This means that the clock on your computer is updated to match the clock on the time server, which can help ensure that the clock on your computer is accurate. Your clock is typically updated
    once a week and needs to be connected to the Internet for the synchronization to occur.
    Note
    If your computer is on a domain, you can't synchronize your clock with an Internet time server.
    Open Date and Time by clicking the Start button, clicking Control Panel, clicking Clock, Language, and Region, and then clicking Date and Time.
    Click the Internet Time tab, and then click Change settings. If you are prompted for an administrator password or confirmation, type the password or provide confirmation.
    Click Automatically synchronize with an Internet time server, select a time server, and then click OK.

  • How to move SQL database from one location to another location i.e. from C' drive to D' drive

    Hi, How to move SQL database from one location to another location i.e. from C' drive to D' drive ? please share some link.
    Thanks and Regards, Rangnath Mali

    Hi Rangnath,
    According to your description, my understanding is that you want to move databased from C drive to D drive.
    You can detach Database so that the files become independent, cut and paste the files from source to destination and attach again.
    There are two similar posts for your reference:
    http://mssqltalks.wordpress.com/2013/02/28/how-to-move-database-files-from-one-drive-to-another-or-from-one-location-to-another-in-sql-server/
    http://stackoverflow.com/questions/6584938/move-sql-server-2008-database-files-to-a-new-folder-location
    Best Regards,
    Wendy
    Wendy Li
    TechNet Community Support

  • I have a string 2012-05-22T23:23:42.263-07:00. so i want to convert in date with indian time zone   can any one help me out

    i have a string 2012-05-22T23:23:42.263-07:00. so i want to convert in date with indian time zone   can any one help me out

    What does this have to do with iPhone tech support?

  • How to seperate the data with comma seperator ??

    Hi,
      How to seperate the data with comma seperator ??
    E.g i havea row like
    Userid,number of days,Total Records
    user1,10,100000
    So,i will get 10,10000 in the same field and i need to seperate 10 and 10000 so what is the abap function for that
    Praff

    like this ...
    SPLIT field AT ',' INTO
       userid
       days
       records.
    is this what you need?
    Mike

  • How can I retrieve data on a time machine if I have forgotten the password?

    How can I retrieve data on a time machine if I have forgotten the password?

    There are so many passwords.. which one do you mean?
    TC password or disk password in the TC.. no problem.. soft reset.
    Or recover the password.. via the Tesserax method.
    https://discussions.apple.com/docs/DOC-3372
    If you encrypted the backup in TM and have forgotten that password you are doomed.. there is no way to recover it I know of.. there is a warning.. very clear.. do not forget the password.
    http://pondini.org/TM/31.html
    Pink box at the bottom.

  • How to save the data of ABAP report into a notepad in desktop location???

    HI all,
    Can any one tell me how to transfer the data of ABAP report into a Notepad.
    Actually I have to schedule a ABAP report in background on daily basis and I want to transfer the
    whole record into Notepad.
    If any program is available for this..please clearify the relevent code for transferring.
    Thanks
    Rajeev

    declare a character type internal table.
    now move your data from it_data ( internal table with data ) into table itab.
    since you are running this report in background, you cannot save it to the desktop. Instead give any app server location
    data: itab(400) occurs 0 with header line.
    field-symbols: <fs1> type any.
    data: gv_file type rlgrap-filename default 'TEST.TXT'.
    data: gv_filepath type rlgrap-filename default <path>.
    LOOP AT it_data.
        DO 100 TIMES.
          ASSIGN COMPONENT sy-index OF STRUCTURE it_data TO <fs1>.
          IF sy-subrc = 0.
            CONCATENATE itab <fs1> INTO itab SEPARATED BY ' '.
          ELSE.
            EXIT.
          ENDIF.
        ENDDO.
        SHIFT itab LEFT DELETING LEADING ' '.
        APPEND itab.
        CLEAR itab.
      ENDLOOP.
      concatenate gv_filepath '/' gv_file into gv_file.
      OPEN DATASET gv_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc = 0.
        LOOP AT itab.
          TRANSFER itab TO gv_file.
        ENDLOOP.
        CLOSE DATASET gv_file.
      ENDIF.

  • How to I convert data from oracle database into excel sheet

    how to I convert data from oracle database into excel sheet.
    I need to import columns and there datas from oracle database to microsoft excel sheet.
    Please let me know the different ways for doing this.
    Thanks.

    asktom.oracle.com has an excellent article on writing a PL/SQL procedure that dumps data to an Excel spreadsheet-- search for 'Excel' and it'll come up.
    You can also use your favorite connection protocol (ODBC, OLE DB, etc) to connect from Excel to Oracle and pull the data out that way.
    Justin

Maybe you are looking for

  • Log4j on Resin problem

    Hi, I wrote a small web application in Java which implements log4j. I wrote it on my personnal computer which runs Linux. When I try to run it on my website (which is a Windows server), I get some errors. I sometimes get this one: 500 Servlet Excepti

  • Flash, ActiveX and FlashVars

    Hello everybody. I looked in the forums and searched, but so far I got no solution. Is there a simple js that takes flashvars? Or I have to do it all over again? (since is all working with flashvars)

  • Sharing photos from apps to Facebook

    I have several photo apps but none of them seem to let me share a photo to one of th pages I admin, only my personal page. This makes no sense so i assume I'm missing something Thx Paul

  • Merging help desk tickets

    is there a way that i can relate a ticket that was opened as a duplicate without closing it? i would like to have the ability to relate multiple tickets back to a single master ticket. the lesser tickets would get a reference in some way to the maste

  • Subquery to select maximum date

    I am trying to work in a subquery that captures only the most recent scheduled hearing date, without converting the entire report to a command statement. Is there a way to do that? I've been trying using formula fields and sql expression fields witho