Extract day from date_time

Hi, Everyone,
I have a date_time field "[29:23:53:25]" stored as varchar2(40) in my table.
i want to extract "29" as the date and
"23:53:25" as time as two different columns.
Could you pls guide me how to do it in oracle version 11.1.0.6 ?
Thanks in advance

Hi,
If the :-delimited parts have fixed lengths, use SUBSTR, as Sb92075 said.
If not (e.g., if you can have 1- or 3-digit numbers) then you might want to use regular expressions, like this:
SELECT     REGEXP_SUBSTR ( str
                , '\d+'
                )          AS day
,     REGEXP_SUBSTR ( str
                , ':(\d+:\d+:\d+)'
                , 1
                , 1
                , NULL
                , 1          -- New in Oracle 11
                )          AS hour_minute_second
FROM     table_x; 
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements), and the results you want from that data.
Explain, using specific examples, how you get those results from that data.

Similar Messages

  • Extrating day from date

    Hi All,
    Extracting day form sysdate is <?xdoxslt:sysdate(‘Day’)?>
    but i want to extract day from <?xdoxslt:ora_format_date_offset(xdoxslt:sysdate('YYYY-MM-DD'),1,'-')?> (sysdate-1 date's day)
    How can i ? any ideas pleae share me.
    Thanks

    DD is working fine
    <?xdoxslt:xdo_format_date($_XDOXSLTCTX,(xdoxslt:ora_format_date_offset(xdoxslt:sysdate('YYYY-MM-DD'),1,'-')),’DD’)?>
    Day and Dy is not working giving result like check boxes
    <?xdoxslt:xdo_format_date($_XDOXSLTCTX,(xdoxslt:ora_format_date_offset(xdoxslt:sysdate('YYYY-MM-DD'),1,'-')),’Day’)?>
    do i need to give any supporting format for xdo_format_date?

  • Extract data on report between last 30 days from current date.

    Hi Experts,
    Ealrier i had provided user promt to select the date range, now i need to schedule the report for this i have to set the date between last 30 days from current date.
    How can i add this in formaula on record selection.
    before:
    {pm_process.pm_creation_date} in {@Start Date to UTC} to {@End Date to UTC}
    I tried:
    {pm_process.pm_creation_date} in CurrentDate() - 30 to CurrentDate()
    But this is diplaying me only data of 30th date from current date.
    Please advice.

    Hi Brian,
    Thank you!
    1. I have not created any function for {pm_process.pm_creation_date} in [CurrentDate() - 30 to CurrentDate()] i am just adding this on Record Selection and its not helping.
    2. {pm_process.pm_creation_date} in Last30Days; this is throwing below error.
    please advice what to be done?

  • Is it possible to save / extract data from a MS SQL database 2008 using lookout 6.2?

    Is it possible to save / extract data from a MS SQL database 2008 using lookout 6.2?
      Now a days we are saving / extracting data in a excel spreadsheet, but we would like to do that using a database because it is better.

    You can use ODBC connection to work with SQL Server database.
    Use SQLExec object to execute the SQL statement. Here is a KB about the SQL statement.
    http://digital.ni.com/public.nsf/allkb/4ADEEA04CD24AE0B862565E20002A16F?OpenDocument
    To write data to spreadsheet is more straightforward because Lookout has built-in spreadsheet object. But you need to write SQL statement by yourself to interact with other database.
    To read the data back is the same way. Just use "select" SQL statement to query. You can use Datatable object to query.
    The "Data Source" can be "DSN = data source name;". The data source name is configured in Control Panel->Administrative Tools->Data Sources(ODBC).
    Ryan Shi
    National Instruments

  • How to extract data from essbase to oracle database incrementally?

    I have to extract data from essbase to an oracle database table incrementally using informatica , can anyone tell me how to do it or give me some tips. I have been thinking about it for a whole day but have no ideas.
    I cannot do the delete & insert method because this oracle database table is a interface table that has to deliver the data to Oracle ESB tables.
    Thanks in advance....

    Hi,
    Have you read through :-
    Oracle Data Integrator Adapter for Hyperion Essbase Getting Started - http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/odiess_getting_started.pdf
    Oracle Data Integrator Adapter for Hyperion Essbase User's Guide - http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/odiess_users.pdf
    If you have read them and are still have a problem at what stage are you having the issues?
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • "An error occurred while extracting files from the package "BaseSystem.pkg".

    Hello!
    I have a
    MacBookPro5,5
    Prozessortyp:Intel Core 2 Duo
    Prozessorgeschwindigkeit:2.26 GHz
    Anzahl der Prozessoren:1
    Gesamtzahl der Kerne:2
    L2-Cache:3 MB
    Speicher:2 GB
    Busgeschwindigkeit:1.07 GHz
    Boot-ROM-Version:MBP55.00AC.B03
    SMC-Version (System):1.47f2
    Hardware-UUID:A2DD27C4-9829-5A4D-854B-485EF8A6B20F
    Problem:
    I upgraded Leopard to Snow Leopard. Everything worked fine for a month. To free up disk space I deleted some of the iPhoto flders (modfied and original images). Everything worked still fine. Shut down the computer. Next day it was incredibly slow. At the same time the indexing was running. I stopped indexing, but stll slow. Every operation took minutes. I tried all the tricks that I found in the internet (repaired file permissions, repaired disk, cleared PRAM , moved big filed from desktop, etc.). After 24 full hours of trying all this I decided to erase the hard drive and reinstall, directly from the Snow Leopard Install disk, but it fails after downloading the packages. Below is the part of the log. Then I tried to use the old Leopard install DVD to reinstall Leopard, it then sais estimated time 12 hours or so and eventually crashed, spitting out a lot of "reportcrash" in the log. What is going on? I'm running out of options. Any advice? Would zeroing the hard drive help? If nothing else I plan to buy a new hard drive, since the only explanation I have is that there is a problem with the hard driven although the disk utility says it is OK. I need a bigger one anyway. Any ideas? Thank you!
    Aug 16 05:17:31 localhost OSInstaller[139]: IFPKInstallElement (191 packages)
    Aug 16 05:17:35 localhost OSInstaller[139]: PackageKit: ----- Begin install -----
    Aug 16 05:17:35 localhost OSInstaller[139]: PackageKit: request=PKInstallRequest <191 packages, destination=/Volumes/Macintosh HD>
    Aug 16 05:17:36 localhost OSInstaller[139]: PackageKit: Extracting /Volumes/Macintosh HD/Mac OS X Install Data/BaseSystem.pkg (destination=/Volumes/Macintosh HD/.OSInstallSandbox-tmp/Root, uid=0)
    Aug 16 05:31:59 localhost Unknown[80]: /SourceCache/AppleFSCompression/AppleFSCompression-24.0.1/Common/DataPool.c:116 : Error: finished pool without filling it
    Aug 16 05:31:59 localhost Unknown[80]: /SourceCache/AppleFSCompression/AppleFSCompression-24.0.1/Common/commonUtils.c: 315: Error: fh_pread -1
    Aug 16 05:31:59 localhost Unknown[80]: /SourceCache/AppleFSCompression/AppleFSCompression-24.0.1/Common/StreamCompress or.c:236: Error: write failed for /Volumes/Macintosh HD/.OSInstallSandbox-tmp/Root//System/Library/Frameworks/OpenCL.framework/Versi ons/A/Resources/runtime.amdil.bc: Invalid argument
    Aug 16 05:31:59 localhost Unknown[80]: /SourceCache/AppleFSCompression/AppleFSCompression-24.0.1/Common/StreamCompress or.c:260: Error: futimes failed for /Volumes/Macintosh HD/.OSInstallSandbox-tmp/Root//System/Library/Frameworks/OpenCL.framework/Versi ons/A/Resources/runtime.amdil.bc: Invalid argument
    Aug 16 05:31:59 localhost Unknown[80]: /SourceCache/AppleFSCompression/AppleFSCompression-24.0.1/Common/StreamCompress or.c:829: Error: returning errno 22 from FinishStreamCompressorQueue
    Aug 16 05:32:10 localhost OSInstaller[139]: PackageKit: Install Failed: PKG: extracting "com.apple.pkg.BaseSystem"\nError Domain=PKInstallErrorDomain Code=110 UserInfo=0x12c8366a0 "An error occurred while extracting files from the package “BaseSystem.pkg”." Underlying Error=(Error Domain=BOMCopierFatalError Code=22 UserInfo=0x12e703300 "The operation couldn’t be completed. FinishStreamCompressorQueue error") {\n    NSFilePath = "/Volumes/Macintosh HD/.OSInstallSandbox-tmp/Root";\n    NSLocalizedDescription = "An error occurred while extracting files from the package \U201cBaseSystem.pkg\U201d.";\n    NSURL = "BaseSystem.pkg -- file://localhost/Volumes/Macintosh%20HD/Mac%20OS%20X%20Install%20Data/index.pro duct";\n    NSUnderlyingError = "Error Domain=BOMCopierFatalError Code=22 UserInfo=0x12e703300 \"The operation couldn\U2019t be completed. FinishStreamCompressorQueue error\"";\n    PKInstallPackageIdentifier = "com.apple.pkg.BaseSystem";\n}
    Aug 16 05:32:10 localhost OSInstaller[139]: install:didFailWithError:Error Domain=PKInstallErrorDomain Code=110 UserInfo=0x12c8366a0 "An error occurred while extracting files from the package “BaseSystem.pkg”." Underlying Error=(Error Domain=BOMCopierFatalError Code=22 UserInfo=0x12e703300 "The operation couldn’t be completed. FinishStreamCompressorQueue error")
    Aug 16 05:32:11 localhost OSInstaller[139]: Install failed: Die Installation ist aufgrund eines Fehlers fehlgeschlagen. Wenden Sie sich an den Hersteller der Software.
    Aug 16 05:32:13 localhost OSInstaller[139]: Allowing machine sleep.
    Aug 16 05:32:15 localhost OSInstaller[139]: Memory statistics for 'Installation ist fehlgeschlagen' pane:
    Aug 16 05:32:15 localhost OSInstaller[139]: Physical Memory Allocation:   139 MB wired,   259 MB trapped,   397 MB active,     7 MB inactive,  1246 MB free,  1650 MB usable,  2048 MB total

    It sounds to me like your Internal Hard Drive is failing.
    I recommend you buy a new one, that is a good candidate for replacing the old one, but install it in an External enclosure and Install a fresh Mac OS X on it from the DVD. You can boot your Mac from any attached drive.
    The new System can be used to get some work done, check your emails, and takes the pressure off resolving this immediately. You can also attempt to salvage files off the old drive if needed.
    Once things seem to be working, then move the new drive inside the computer. Failures at this point may be due to bad cable, which has been a problem in some of these MacBooks.
    Use security erase, write Zeroes, one pass, to re-write every block on the old drive. Any block discovered to be bad will be replaced with spares the drive holds in reserve for this purpose. If more than 10 blocks are pared on one pass, "Initialization Failed!" will be the result. Although you can try the erase again, there is some question whether you want to trust this drive with your precious data.

  • Error while extracting data from CRM

    Dear all,
    I have used some standard and generic datasources to extract data from CRM. These were working fine for more than a year and are scheduled in Process chains. For the past few days I am getting Caller 09 error as shown below, only for the generic datasources. I have checked the connection,replicated the datasources and activated them, reinitialized and have tried all the solutions that were posted earlier, but still the process chain fails. When I execute the process chain for generic datasources manually, it is working fine.
    When I tried in RSA3 for both standard and generic datasources in CRM with update mode D, I get a message 'Error occured during the extraction',
    Kindly suggest what can be the problem.
    Error message from the source system
    Diagnosis
    An error occurred in the source system.
    System Response
    Caller 09 contains an error message.
    Further analysis:
    The error occurred in Extractor .
    Refer to the error message.
    Procedure
    How you remove the error depends on the error message.
    Note
    If the source system is a Client Workstation, then it is possible that the file that you wanted to load was being edited at the time of the data request. Make sure that the file is in the specified directory, that it is not being processed at the moment, and restart the request.
    Thanks all in advance.
    Regards
    Adhira Anand

    Hi Meyappan,
    I have checked SM37, SM21 and ST22. There are no errors.
    in SM37 the below log is displayed.
    Job started
    Step 001 started (program SBIE0001, variant &0000000005420, user ID ALEREMOTE)
    Asynchronous transmission of info IDoc 2 in task 0001 (0 parallel tasks)
    DATASOURCE = ZCRM_SRV_DEFECT
    RLOGSYS    = CLNT645BIP
    REQUNR     = REQU_4JHQ8HH6KA40JHC1TYLYIV2W2
    UPDMODE    = D
    LANGUAGES  = *
             Current Values for Selected Profile Parameters               *
    abap/heap_area_nondia......... 2000000000                              *
    abap/heap_area_total.......... 2000000000                              *
    abap/heaplimit................ 40000000                                *
    zcsa/installed_languages...... DE                                      *
    zcsa/system_language.......... E                                       *
    ztta/max_memreq_MB............ 2047                                    *
    ztta/roll_area................ 6500000                                 *
    ztta/roll_extension........... 2000000000                              *
    1 LUWs confirmed and 1 LUWs to be deleted with function module RSC2_QOUT_CONFIRM_DATA
    IDOC: Info IDoc 2, IDoc No. 101415, Duration 00:00:00
    IDoc: Start = 13.10.2010 22:51:39, End = 13.10.2010 22:51:39
    Synchronized transmission of info IDoc 3 (0 parallel tasks)
    IDOC: Info IDoc 3, IDoc No. 101416, Duration 00:00:00
    IDoc: Start = 13.10.2010 22:51:42, End = 13.10.2010 22:51:42
    Job finished

  • Error while extracting data from Generic datasource

    Hello Gurus,
    I have encountered an error "Errors in source system" with status red while extracting data from generic datasource into DSO.
    I have done below things:-
    1. Checked the jobs in source system, the job is successfully completed
    2. The generic datasource is active and supporting delta with calender day  in source system.
    3. No TRfc error and no idocs stucked.
    4. No short dumps in source system.
    5. The delta queue(RSA7) is showing 0 with status as green.
    6. Replicated the datasource On BW side and also activated the transfer rules by RS_TRANSU_ACTIVATE_ALL
    The problem has not yet solved. Could you guys please suggest me what might be the reason for this error......
    Thanks,
    Sonu

    Hello,
    I have used the generic delta using calender day.
    Safety upper limit : - 1
    Safety lowerr limit : - 0
    I have made the entries in va01 transaction, but the delta queus is not getting updated which should show 1.
    Do Generic extraction require any job to transfer data from Database table to delta queue.
    We are not able to get the delta records on BW side. Please suggest.
    Please suggest.
    Thanks,
    Sonu

  • How do i extract pages from within a pdf document?

    how do i extract pages from within a pdf document?

    Hi adobespurs,
    To extract pages from a PDF, you need to use Acrobat. If you don't have Acrobat, you can try it for free for 30 days. Please see www.adobe.com/products/acrobat.html for more information.
    Best,
    Sara

  • Which is better? Extracting images from directories or from database?

    Good day,
    I would like to start a discussion on extracting image (binary data) from a relational database. Although some might say that extracting image from directories is a better approach, I m still sceptic on that implementation.
    My argument towards this is based on the reasonings below:
    1. Easier maintainence. - System Administrator can do backup from one place which is the database.
    2. High level of security - can anyone tell me how easy it is to hack into a database server?
    3. image is not dependent on file structure - no more worries about broken links because some one might mistakenly change the directory structure. If there needs to be a change, it will be handle efficiently by the database server.
    The intention of my question is to find out :
    1. Why is taking image from a directory folder which resides on the web server is better than using the same approach from the database?
    2. How is this approach (taking image from directory) scalable if there is thousands of images and text that needs to be served?
    If anybody would be kind enough to reply, I would be most grateful.
    Thank You.
    Regards
    hatta

    Databases are typically more oriented towards text and number content than binary content, I believe. If you carry images in the database you will need to run them through your code and through your java server before they are displayed. If they are held in a directory they will be called from hrefs in the produced page, which means that they are served by your static server. This is quicker because no processing of the image is required. It also means the Database has to handle massively less data. Depending on the database this should be far quicker to query.
    It is worth noting that it is also quite difficult to actually change mime-types on a page to display a picture in the midst of HTML- the number of enquiries on these pages about this topic should be enough to illustrate this.
    If you give over controls of all the image file handling to your java system (which I do when I write sites like the one you describe) then the actual program knows where to put the images and automatically adds them to the database. The system administrator never needs to touch them. If they want a backup they save the database and the website directory. The second of those should be a standard administrative task anyway, so there is not a huge difference there. The danger of someone accidentally changing the directory structure is no greater than the danger of someone accidentally dropping a database table- it can be minimised by making sure your administrators are competent. Directory structures can be changed back, dropped tables are gone.
    The security claim is slightly negated because you still have to run a webserver. Every program you run on your server is vulnerable to attack but if you are serving web pages you will have a server program that is faster than a database for image handling. You are far more at risk from running FTP or Telnet on your server or (worst of all) trying to maintain IIS.
    The images in directory structure is more scalable because very large databases are more likely to become unstable and carrying a 50k image in every image field rather than 2 bytes of text will make the database roughly 25000 times larger. I have already mentioned the difference in serving methods which stands in favour of recycling images. A static site will be faster than a dynamic site of equivalent size, so where you can, take advantage of that.

  • Best way to extract data from 2 years records/Numbers files for tax return?

    Hi
    I am wanting to find a way of generating my annual tax returns from my financial records, which will be stored in a separate Numbers file for each Calendar Year.
    As the Tax Year (in the UK) is different from the Calendar Year (in the UK it runs from April 6 to April 5), I would need to extract information from two different Numbers files, to a third Numbers file. Is it possible to do this, and would this be relatively straightforward?
    I'd be interested to hear from others who have used Numbers for a similar purpose, and how they have organised things.
    Thanks
    Nick

    The easiest soluce is to forget the use of separate documents.
    Use one sheet per year and it will be really easy to achieve your goal using only formulas.
    With separate documents, the unique soluce is to use an AppleScript.
    I may write one but I'm a bit tired because I posted a lot of such soluce and in most cases, I don't know if they give satisfaction to the askers.
    Coding for the clouds isn't my cup of tea so I think that for some days, I will leave AppleScript and will work upon the archives of my workshop.
    Yvan KOENIG (VALLAURIS, France) mercredi 4 août 2010 19:15:58

  • How to know active user in Ad ? & how many days from not use user id ?

    How to know active user in Ad ? & how many days from not use user id ?
    Thanks & Regards, Amol . Amol Dhaygude

    Hi Amol,
    You can use the below command from the command prompt of DC to get all the AD users who are inactive for last
    X weeks,
                                    dsquery
    user -inactive X 
    To extract the inactive user information to a CSV file use the below command,
                   dsquery user -inactive X > c:\TestFolder\InactiveUsers.csv
    NOTE: The value
    X represents number of weeks, for example if your requirement is to find the inactive users for last 90 days then the
    X value should be 13.
    Regards,
    Gopi
    JiJi Technologies

  • How can I extract metadata from file names?

    If I want to extract metadata from file names? How can I do that? I want to read through the file names and when I get to a certain character ("-"), I can take the string just before that character and store it in a column in SharePoint. Is this
    do-able through scripting? 

    If I want to extract metadata from file names? How can I do that? I want to read through the file names and when I get to a certain character ("-"), I can take the string just before that character and store it in a column in SharePoint.
    Is this do-able through scripting? 
    You should be able to leverage the split method.
    In PowerShell It would look like:
    # Gather the file name
    $file = "myawesome_filename-Month-Day-Year-Ect.doc"
    #split the file name by the "-" character
    $file = $file.split("-")
    # Use a foreach Loop to gather the individual items.
    foreach ($item in $file) {
    write-host $item
    #Outputmyawesome_filename
    Month
    Day
    Year
    Ect.doc
    # If you want to only grab the first item, you can do $file[0] <-- powershell starts counting with zero base.
    $file[0]
    #output
    myawesome_filename
    Entrepreneur, Strategic Technical Advisor, and Sr. Consulting Engineer - Strategic Services and Solutions Check out my book - Powershell 3.0 - WMI: http://amzn.to/1BnjOmo | Mastering PowerShell Coming in April 2015!

  • Extract date from date

    Hi All,
    I have a query. I want to name of the day from the date selected from the record.
    I know there is a function Extract that extracts the day from the date. But it returns the day number of the month. I want to extract the name of the day i.e. wether it is 'Monday','Tuesday' etc.
    Is there any function that can do the above task.
    My complete requirement is to extract all emplid except those emplid from the record JOB where the eff_date is either 1 or 2 of the month and the date is Monday.
    Any help is appreciated.
    Regards,
    Amit

    Why not post your code, it will more easy to help you ?
    You're not so far from the solution with the query above...
    Anyway, try :
    select *
    from emp a
    where not exists (select 1
                      from emp b
                      where to_char(b.hiredate,'FMDay')='Monday'
                      and to_char(b.hiredate,'DD') in (1,2)
                      and a.empid=b.empid);Nicolas.

  • Select extract(month from sysdate)+6 = returns 13 and not 1(jan)

    Hi
    I am using the following query to get the month 6 months from now.
    select extract(month from sysdate)+6
    from dualHow can I say that the month should be 6 months from todays month? It worked all these days because this month + 6 was always a valid month. Now it returns 13.

    When I run the following, I get '1'. I am expecting '01'. What am I doing wrong here?
    SELECT substr(lpad(to_number(to_char(ADD_MONTHS(SYSDATE, 6),'MM')),2),1,2) FROM DUAL;
    I need number - so using to_number. I need to extract the month, so using to_char. If someone could help me get 2 digits for the month and simplify the query if possible - would be great.
    The table has month and date stored as number (bad idea I know but thats how it is). Now for January 31, it is stored as 131. For 15 Feb it is 215. What I need is give me records where the month is 6 months from now. Something like:
    to_number(substr(lpad(tbl1.monthdt, 4, '0'), 1, 2)) in
    substr(lpad(to_number(to_char(ADD_MONTHS(SYSDATE, 6),'MM')),2),1,2)Message was edited by:
    bpel

Maybe you are looking for