Is There A Way To Retreive Data By Combining Two Columns!

Hi Everybody!
The four feilds say Date1,Date2,Date3,Date4 Date1 and Date3 are date datatypes Date2 and Date4 are Char Datatypes.
I want to find out the date difference as follows
Date1=29-jun-2001
Date2=13:00:00
Date3=29-jun-2001
Date4=13:10:34
is there any option to write a query to get the date difference
yours truly
Nagaraju

Assuming that Date1 and Date3 don't contain a time component, then the expression :-
to_date(to_char(Date1, 'dd-Mon-yyyy') || ' ' || Date2, 'dd-Mon-yyyy hh24:mi:ss')
to_date(to_char(Date3, 'dd-Mon-yyyy') || ' ' || Date4, 'dd-Mon-yyyy hh24:mi:ss')
will give the number of days' difference between Date3+Date4
and Date1+Date2.
Plugging in your data would give .007337963.
And then you could convert that to hours, minutes and seconds.
An example follows of a script to do that :-
-- x.sql
-- =====
-- convert decimal number into
-- days, hours, minutes, seconds
set feedback off verify off serveroutput on size 1000000;
declare
input_number number :=0.;
num_days pls_integer :=0;
num_hours pls_integer :=0;
num_mins pls_integer :=0;
num_secs number :=0.;
leftover number :=0.;
begin
input_number := &1;
num_days := trunc(input_number);
leftover := input_number - num_days;
num_hours := trunc(leftover * 24);
leftover := (leftover * 24) - num_hours;
num_mins := trunc(leftover * 60);
leftover := (leftover * 60) - num_mins;
num_secs := round((leftover * 60), 2);
dbms_output.put_line(to_char(num_days) || ' days, ' ||
to_char(num_hours) || ' hours, ' ||
to_char(num_mins) || ' mins, ' ||
to_char(num_secs) || ' secs');
exception
when others then
dbms_output.put_line(sqlerrm);
end;
hope this helps

Similar Messages

  • Is there a way to Insert Data into a Lookup Column Type on a SharePoint List Destination in SSIS?

    Greetings.
    I have successfully worked out inserting SQL data (2008 R2) into my 2010 SharePoint list (New, Update, Delete) by creating an SSIS Data Flow Task as outlined here:
    http://fsugeiger.blogspot.com/2010/01/synchronise-sql-table-with-sharepoint.html
    However, the problem I am running into is inserting data into the SharePoint Columns that are "Lookup" column types. I verified that all of the values I am copying from SQL into the SharePoint lookup column exist in the customn list it is pointing to. It
    is important to have this column be a lookup column as it links to another custom list that has many more columns of related information.
    I have read and re-read the SharePoint SSIS Adapters 2011.docx from
    http://sqlsrvintegrationsrv.codeplex.com/ and the only section that seems to apply is this:
    "Looking Up Values in a SharePoint List
    If you have to look up a value in a SharePoint list, you can use the Lookup transformation in your data flow, and use the SharePoint List source to load the lookup table. You may have to add a Derived Column transformation or a Script component that splits
    data in the lookup column on the ";#" delimiter to separate the ID value from the description.
    If you are replacing values in your data with the values that you look up in the list, then loading the changed data back into SharePoint, you only have to include the ID from the lookup column. SharePoint ignores the description if you include it."
    I am not sure if the above statement means that I should be passing the assocaited ID's other than the actual data into the SharePoint List destination. If that is the case, that will not really work as the lookup contains hundreds of rows. Not too mention
    I have several of these lookup column types pointing to several different lists.
    Any guidance in how I can put data into a SharePoint Lookup column type via Data Flow Task would be so much appreaciated.
    Thank you.
    My errors are:
    Error: 0x0 at Data Flow Task, SharePoint List Destination: Error on row ID="1": 0x1 - Unspecified error, such as too many items being updated at once (batch), or an invalid core field value.
    Error: 0xC0047062 at Data Flow Task, SharePoint List Destination [1903]: Microsoft.Samples.SqlServer.SSIS.SharePointListAdapters.PipelineProcessException: Errors detected in this component - see SSIS Errors at Microsoft.Samples.SqlServer.SSIS.SharePointListAdapters.SharePointListDestination.ProcessInput(Int32
    inputID, PipelineBuffer buffer) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProcessInput(IDTSManagedComponentWrapper100 wrapper, Int32 inputID, IDTSBuffer100 pDTSBuffer, IntPtr bufferWirePacket)
    Error: 0xC0047022 at Data Flow Task, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "SharePoint List Destination" (1903) failed with error code 0x80131500 while processing input "Component Input" (1912). The identified
    component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will

    I have found a solution to my problem and thought I would share it here in case there are others who are struggling with the above scenario. If you have a better way, I would love to hear about it since my way is a bit tedious.
    In a nutshell, in order to have an SSIS package put data from an OLE DB Source into a SharePoint List Destination Lookup Column, you need to pass the ID of the value that is being looked up, not the value that is in the “master” OLE DB source.
    Rough explanation, OLE DB Source value for column “Approp” is “4005” --> SQL matches “4005” with the ID in the new lookup table (“4005” = ID “5” as defined in the SharePoint lookup list) --> “5” gets passed into SharePoint List destination lookup
    column --> SharePoint displays “4005” and successfully links to the lookup list.
    Funny thing (not really), the error(s) outlined in my original post are not related in getting data into a SharePoint Lookup column as I am now successful in getting data into the system but I am still getting the same above error(s). I think it has to do
    with the ID column in the SharePoint list destination. What I can’t seem to figure out is why since I am not linking any data to that ID column (at least on new records). I am however linking it on Update and Delete and the errors mentioned above disappear
    and things work well.
    There are three tasks that need to get done in order to get data from SQL into a SharePoint lookup column assuming you have already set up your SharePoint lookup lists:
    1. Create new lookup table(s) in SQL that has the IDs from the SharePoint Lookup list and the values coming from the “master” OLD DB Source. You can see the ID column in SharePoint by toggling it on in a view.
    2. Create a SQL command that JOINs all the databases and tables so that the ID is passed and not the value into the SharePoint lookup column
    3. Change the “Data access mode” to “SQL Command” instead of the “Table or view” in the OLE DB Source and paste your command into the “SQL command text:” area.
    Other helpful info is that you may also need to add additional columns in the new lookup tables in SQL for the scenarios when the data is not unique. You can see this two times in my SQL command example for Units and JobTitles:
    SELECT
    pps.SSNm,
    pps.file_updated,
    pps.Employee_id,
    /* pps.CheckDistNm,*/
    Check_Distribution_id = COALESCE( d.ID, 0 ),
    pps.Job_nbr,
    pps.SeqNm,
    pps.action_eff_dt,
    Fund_id = COALESCE( f.id, 0 ),
    Appropriation_id = COALESCE( ap.id, 0 ),
    ActionCode_id = COALESCE( ac.id, 0 ),
    SpecNumber_id = COALESCE( jt.ID, 0 ),
    pps.Employee_id,
    /* pps.Fund,
    pps.Approp,
    pps.Unit,*/
    Unit_id = COALESCE( u.ID, 0 ),
    PosNm,
    PosCode,
    pps.LastName,
    pps.FirstName,
    pps.MI
    FROM
    x_PPS.aReportVw.pps_screens_active AS pps
    LEFT OUTER JOIN dbo.DistributionNumbers AS d ON
    pps.CheckDistNm = d.Check_Distribution
    LEFT OUTER JOIN dbo.Units AS u ON
    pps.Fund = u.Fund AND
    pps.Approp = u.Approp AND
    pps.Unit = u.Unit
    LEFT OUTER JOIN dbo.Appropriations AS ap ON
    pps.Approp = ap.Approp
    LEFT OUTER JOIN dbo.Funds AS f ON
    pps.Fund = f.Fund
    LEFT OUTER JOIN dbo.ActionCodes AS ac ON
    pps.ActionCode = ac.ActionCode
    LEFT OUTER JOIN dbo.JobTitles AS jt ON
    pps.SpecNm = jt.SpecNumber AND
    pps.JurisClass = jt.JurisClass

  • Is there any way to retreive the FileName in the mapping

    Is there any way to retreive the FileName and so that I can use that in my mapping. This is FILE2RFC scenario with NO BPM.
       I am using the adapter specific message attributes in the file sender CC.
    Thanks,
    Ravi
    null

    Yes you can retreive it.  Create an simple user defined function in the mapping and use the following code.
    Imports: com.sap.aii.mapping.api.*;
    Parameter: String filename
    Paramter: String filename;
    filename = fileName + ".DAT";
    DynamicConfiguration conf = (DynamicConfiguration) container
    .getTransformationParameters()
    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
    conf.put(key, filename);
    return filename;
    Or
    Just do whatever mentioned in this weblog:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    ---Satish

  • I have an iphone and my daughter has an ipod.  She has all my contacts showing up on her ipod.  I deleted them and now they are gone from both.  is there any way of retreiving this deleted information.

    I have an iphone and my daughter has an ipod.  She has all my contacts showing up on her ipod.  I deleted them and now they are gone from both.  is there any way of retreiving this deleted information.

    When you share an iCloud account, any data you sync with the account is merged, and any actions you take on one device (such as deleteing contacts) is synced to all other devices sharing the account.  To avoid this, each person's device(s) should have a separate iCloud account with a separate ID.  (You can continue to share your iTunes account; it does not need to have the same ID as the one used for iCloud.)
    To create separate icloud accounts, decide which iPhone will be keeping the current iCloud account.  On the one that will be changing accounts, go to Settings>iCloud, scroll to the bottom and tap Delete Account.  (This will only delete the account from this phone, not from iCloud.  The phone that will be keeping the account will not be effected by this.)  When prompted about what to do with the iCloud data, be sure to select Keep On My iPhone.  Next, set up a new iCloud account using a different Apple ID (if you don't have one, tap Get a Free Apple ID at the bottom).  Then turn iCloud data syncing for contacts, etc. back to On, and when prompted about merging with iCloud, choose Merge.  This will upload the data to the new account.
    Finally, to un-merge the data you will then have to go to icloud.com on your computer and sign into each iCloud account separately and manually delete the data you don't want (such as deleting the other person's contacts from your account, and vice versa).
    As for recovering the deleted contacts, you can try restoring her phone from her most recent backup.  This may recover the contacts, however it often doesn't.  Restoring to an iCloud backup has to be done in the initial setup process.  If she have any data on your phone now that is not in the backup that she wants to save she will need to do that first.  Then go to Settings>General>Reset and tap Erase All Content and Settings.  You will then go through the setup screens as you did when the phone was new. When given the option, choose Restore from iCloud Backup.  Be sure you are connected to wifi and your charger as this will take some time to finish.

  • My daughter has accidentally deleted all videos from her ipod nano - is there a way of retreiving them?

    my daughter has accidentally deleted all her videos on her ipod nano - is there any way of retreiving them?

    If your daughter owns a 5G Nano (the one with the camera built-in) and she deleted her recorded videos, I'm afraid you are out of luck. There is a small chance that some expensive data recovery solutions can recover some of that, but again the chances are slim.
    B-rock

  • My ipad2 was recently stolen.  I have since purchased an iphone4.  Is there a way to retreive the apps that were on the ipad for use on my iphone or a new ipad once purchased?

    My ipad2 was recently stolen.  I have since purchased an iphone4.  Is there a way to retreive the apps that I had on my ipad for use on my iphone or on a new ipad if purchased?
    Thx.
    Adam

    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    All ipad apps are not neccessarily compatible with iphone.  There are some universal apps.

  • Is there a way of transferring data (music, movies etc) from an external hard drive directly to an iPad Mini?

    Hi Guys,
    Is there a way of transferring data (music, movies etc) from an external harddrive directly to an iPad Mini?
    The reason I ask, is I'm going travelling and don't want to take my macbook with me - but I have a lot of music, movies etc that I want to take.
    Is this possible?
    Thanks, Fintan

    Thanks all.
    I've just come across Hyper Drive Cloud FTP - which allows you to connect any external harddrive or USB stick via WiFi.
    Looks like a pretty good option.
    I've also read that you can use GoodReader app to download files from harddrive to iPad.
    Good review on Wired - http://www.wired.com/reviews/2012/07/cloudftp/
    Product site - http://www.hypershop.com/iUSBport-by-HyperDrive-formerly-CloudFTP-s/218.htm
    Let me know what you think?!

  • Is there a way to import data from excel -when one of the columns in excel is hyperlink column?

     Is there a way to import data from excel  - so if a column is hyperlink - the whole data will move to the list (text + link of the hyperlink column)?
    keren tsur

    Hi,
    According to your description, you want to export excel which contains a hyperlink column to SharePoint list.
    Refer to the following steps:
    Open the Excel, insert/create the table. 
    Now click on any cell of table and go to the ‘Design Tools’.
    Click on the Export and then ‘Export table to SharePoint List’.
    You will see a popup where you need to provide the URL of SharePoint site, list name and description.
    Then click on next, On the next screen you will see columns with data types which are going to create in SharePoint list.
    Now click finish and wait until the operation gets finished. You will see that list gets created in SharePoint site with the records.
    Here are two links, you can use as a reference:
    http://sharepointrhapsody.com/2013/03/25/how-to-create-a-connected-excel-file-to-sharepoint-list/
    http://social.technet.microsoft.com/wiki/contents/articles/18705.sharepoint-2013-how-to-export-excel-sheet-to-sharepoint-list.aspx
    Best Regards,
    Lisa Chen
    Lisa Chen
    TechNet Community Support

  • Is there a way to import data in a spreadsheet or text file into Contacts v7?

    Is there a way to import data in a spreadsheet or text file into Contacts v7? I have a list of about 500 people and their email addresses in FileMaker Pro that I can export in a number of formats that can be manipulated. Is there any way to get those contacts into Contacts without entering them one at a time?

    I have answered my own question. I exported the data from a layout in FileMaker Pro containing the required fields as tab separated text. That produced a .tab file that Contacts wanted nothing to do with. However, when I changed the .tab in the file name to .txt, Contacts accepted it as a file to import (File/Import). I then identified the field in Contacts in which the data in each field in the txt file was to be placed and in it went! The trick was changing .tab to .txt in the name of the file exported by FileMaker Pro.

  • Is there a way to enter data into a numbers cell on the screen directly, no keypad?

    Is there a way to enter data into a numbers cell on the screen directly, no keypad?
    Using a stylus or finger?

    No. You have to use the built-in keyboard or a bluetooth connected external keyboard.
     Cheers, Tom

  • Is there a way to download data into CSV format?

    Is there a way to download data into CSV format?
    I can't do this using delimiter as ',' because user wants the decimal format in the ','s only.
    Any suggestions?

    go through this link...
    Download CSV file in presentation server through FM GUI_DOWNLOAD
    Re: how to create a CSV file
    type-pools:TRUXS.
    data: begin of itab occurs 0,
          vbeln like vbap-vbeln,
          posnr like vbap-posnr,
          end of itab.
    data:  itab1 type TRUXS_T_TEXT_DATA.
      select vbeln
             posnr
             up to 10 rows
             from vbap
             into table itab.
    CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
    EXPORTING
       I_FIELD_SEPERATOR          = ','
      TABLES
        I_TAB_SAP_DATA             = itab
    CHANGING
       I_TAB_CONVERTED_DATA       =  itab1
    EXCEPTIONS
       CONVERSION_FAILED          = 1
       OTHERS                     = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
       CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename = 'C:TEMPtest.TXT'
        TABLES
          data_tab = itab1
        EXCEPTIONS
          OTHERS   = 1.

  • HT4571 I have been trying to add data to my I pad and when I add it it goes to a page that says error. Is there another way to add data?

    I have been trying to add data to my I pad and when I add it it goes to a page that says error. Is there another way to add data?

    The installer is over 5Gb's and could take many hours to download.
    Check the download status in the App Store application.

  • Is there a way to extract data from one of e.g. 7 rows from the multicolumn listbox?

    is there a way to extract data from one of e.g. 7 rows from the multicolumn listbox?

    All the data can be extracted by creating a property node and read the Item Names property...then you get a 2D array of all the rows and columns. Wire that array into an index array function and input the row you want (e.g. the listbox value, if you want the row currently selected...)...that's it. See attached example.
    MTO
    Attachments:
    ExtractRow.vi ‏24 KB

  • Is there a way to export data from a numbers worksheet to address book

    Is there a way to export data from a numbers worksheet to address book

    Yes.  Address Book provides help for this operation:

  • Is there any way to recover data from a cleared soft partition?

    Is there any way to recover data from a cleared soft partition? <eom>

    You could try using 'metarecover'. I don't know if that works after a metaclear, but it's the only think that I could think to try.
    I think you could brute-force search for UFS filesystems within the underlying storage, but that's pretty tedious.
    Darren

Maybe you are looking for

  • "Error at invoice posting"

    Hi all, i am getting an error while posting invoice to G/L accounts saying " Only output tax allowed for account 175000, VN is not allowed" i also tried to deactivate tax code VN. but the error still presist. where should i make the settings. Thanks

  • Object Oriented Modelling and Code Generator

    i have a final yr project on java--any help plzz Objectives: In software development we make extensive use of models to capture details about objects in a domain, the attributes of the objects and the relationships between the objects. Once complete,

  • CSM not load-balancing properly

    Folks, I'm seeing that CSM is not loadbalancing properly to all the servers in the serverfarm. I simulated a failover of one of the servers TS05 and brought it back. After coming online, CSM sent no traffic to that server, as shown below: C7606-1#sho

  • No sound from internal speakers in HP Mini

    i can't hear any sound from internal speakers although if i connect headphones or external speakers i can hear sound!

  • Frame to Servlet Communication

    Hi Friends, I can connect to the servlet through applet by using URLConnection, but the same code I am using for the Frame. I am unable to enter in to servlets it self. I am not getting any error.Any out put.The request is not entering into servlet .