Need help converting a varchar to a date

The following select displays a horizontal column vertically. I need to convert the varchar horizontal column to a date column.
SELECT raso.SRC_SUPL_CD,
case numbers.n
when 1 then
case instr(raso.DT_TM_PHASE_DT,':',1,1)
when 0 then raso.DT_TM_PHASE_DT
else substr(raso.DT_TM_PHASE_DT,1,instr(raso.DT_TM_PHASE_DT,':',1,1)-1)
end
else substr
(raso.DT_TM_PHASE_DT
,1 + instr(raso.DT_TM_PHASE_DT,':',1,numbers.n-1)
,case instr(raso.DT_TM_PHASE_DT,':',1,numbers.n)
when 0 then length(raso.DT_TM_PHASE_DT)
- instr(raso.DT_TM_PHASE_DT,':',1,numbers.n-1) +1
else instr(raso.DT_TM_PHASE_DT,':',1,numbers.n)
- instr(raso.DT_TM_PHASE_DT,':',1,numbers.n-1) - 1
end
end PHASE_DT
from RSSP_API_SELECT_OVERRIDE raso
, (select level n from dual connect by level <= 38) numbers
where length (raso.DT_TM_PHASE_DT) - length (replace(raso.DT_TM_PHASE_DT,':')) + 1
>= numbers.n

An example wouldn't hurt.
As it is now, my reply would be:
SQL> create table rssp_api_select_override
  2  as
  3  select 1 src_supl_cd, '01:12:2006:14:55:00' dt_tm_phase_dt from dual
  4  /
Tabel is aangemaakt.
SQL> SELECT raso.SRC_SUPL_CD
  2       , case numbers.n
  3         when 1 then
  4           case instr(raso.DT_TM_PHASE_DT,':',1,1)
  5           when 0 then raso.DT_TM_PHASE_DT
  6           else substr(raso.DT_TM_PHASE_DT,1,instr(raso.DT_TM_PHASE_DT,':',1,1)-1)
  7           end
  8         else
  9           substr
10           ( raso.DT_TM_PHASE_DT
11           , 1 + instr(raso.DT_TM_PHASE_DT,':',1,numbers.n-1)
12           , case instr(raso.DT_TM_PHASE_DT,':',1,numbers.n)
13             when 0 then length(raso.DT_TM_PHASE_DT)
14                         - instr(raso.DT_TM_PHASE_DT,':',1,numbers.n-1) +1
15             else instr(raso.DT_TM_PHASE_DT,':',1,numbers.n)
16                  - instr(raso.DT_TM_PHASE_DT,':',1,numbers.n-1) - 1
17             end
18           )
19         end PHASE_DT
20    from RSSP_API_SELECT_OVERRIDE raso
21       , (select level n from dual connect by level <= 38) numbers
22   where length (raso.DT_TM_PHASE_DT) - length (replace(raso.DT_TM_PHASE_DT,':')) + 1 >= numbers.n
23  /
                           SRC_SUPL_CD PHASE_DT
                                     1 01
                                     1 12
                                     1 2006
                                     1 14
                                     1 55
                                     1 00
6 rijen zijn geselecteerd.
SQL> select to_date(dt_tm_phase_dt,'dd:mm:yyyy:hh24:mi:ss') from rssp_api_select_override
  2  /
TO_DATE(DT_TM_PHASE
01-12-2006 14:55:00
1 rij is geselecteerd.Regards,
Rob.

Similar Messages

  • Need help converting from 4.0 to 2011

    hello,
    Need help converting files from 4.0 to 2011.
    thank you
    Solved!
    Go to Solution.
    Attachments:
    noise source.vi ‏73 KB
    8673D.vi ‏30 KB
    8970 FREQ.vi ‏26 KB

    attached as 8.2, which you can open
    missing some subVIs - not sure if you already have them
    Attachments:
    8673D.vi ‏13 KB
    8970 FREQ.vi ‏11 KB
    noise source.vi ‏24 KB

  • Need help with representing 2 bits of data in a column

    I Need help representing only 2 bits of data in a column in order to save space.
    Is that possible?

    CommitMan wrote:
    I Need help representing only 2 bits of data in a column in order to save space.
    Is that possible?Yes - using Assembler....
    If you need to count bits to save space, then you must be on 70's, or early 80's, hardware. So using Assembler should not be a problem. Let me guess.. a 8051 microcontroller from the 1980?
    Here's what the 8051 code and memory optimisation manual says:
    >
    The simplest and best way to get dramatic improvements
    in efficiency is to look for all variables that will have only
    binary values (0 and not 0), and define them as type 'bit‘:
    bit myVar;With bit variables, the full set of 8051 bit-level assembler
    instructions can be used to generate very fast and
    compact code. For example, the following C code:
    myVar = ~myVar;
    if (!myVar)
    }Generates only two lines of assembler:
    B200    CPL myVar
    200006  JB myvar,?C0002This example uses only 5 flash bytes and 8 CPU cycles.
    When you use bit variables, you can implement a
    nontrivial line of C code with just one assembler
    instruction.
    >
    <i>PS. Yes, the above is really from a manual for a real 80s microcontroller. And yes, I'm poking fun at your question as saving bits were a problem in the 80s and prior. It should not be a problem in the 21st century information system and database.</i>

  • Need help converting a PDF to excel

    Need help converting a PDF to excel, the icon to convert dissappeared suggestions?

    Open the file in Acrobat, use File --> Save As... --> Microsoft Word.
    Mylenium

  • I am a beginner at Final Cut Pro. Need help converting MPEG-2 to use.

    I am a beginner at Final Cut Pro. I have mpeg-2 video footage that I am trying to import the footage into Final cut, but can't. I understand I need to convert the file format. I am unfamiliar with how to go about the converding file formats and the codec what is the best way to go about converting the file format so I can edit it on Final cut pro?

    Where did the files originate? (How were they created?)
    Some formats can be brought in with the help of plug-ins.
    MPEG Streamclip can usually convert them to Quick Time.
    Russ

  • I need help converting a PDF to a word file. I purchased Acrobat for this purpose?

    I need help using this download. I purchased Acrobat because I need to convert a PDF file to a word file. Can you give me instruction on how to do this.
    Thank you,

    Open the file in Acrobat, use File --> Save As... --> Microsoft Word.
    Mylenium

  • Conversion failed when converting the varchar value to data type int

    Hi, I am unable to resolve this error and would like some assistance please.
    The below query produces the following error message -
    Msg 245, Level 16, State 1, Line 1
    Conversion failed when converting the varchar value 'NCPR' to data type int.
    Select Pc2.Assess,
                    Select Pc1.Title
                    From Pc1
                    Where Pc1.Assess = Pc2.Assess
                ) [Title]
            From Pc2
    However, when I run the query below I get the results shown in the image . Ie. nothing. Pc1 & Pc2 are aliases and are the same table and the assess field is an int. I found NCPR in one cell but that column (prop) is not used in the query. The table
    is nearly 25k rows.
    SELECT * FROM Pc1 WHERE Pc1.Assess LIKE '%NCPR%' OR ISNUMERIC(Pc1.Assess) = 0
    Thank you

    WHERE ISNUMERIC(id) = 1 and there are obviously no 'NCPR' records in the view as per my previous post.
    That is a bad assumption - SQL Server does not have to evaluate the query in the order you are expecting it to.
    Take this simple example
    CREATE TABLE #example
    col1 VARCHAR(50) NOT NULL
    INSERT INTO #example VALUES ('1'), ('2'), ('NaN')
    SELECT * FROM
    SELECT * FROM #example
    WHERE ISNUMERIC(col1) = 1
    ) X
    (3 row(s) affected)
    col1
    1
    2
    (2 row(s) affected)
    compare to
    CREATE TABLE #example
    col1 VARCHAR(50) NOT NULL
    INSERT INTO #example VALUES ('1'), ('2'), ('NaN')
    SELECT * FROM
    SELECT * FROM #example
    WHERE ISNUMERIC(col1) = 1
    ) X
    WHERE col1 = 1
    (3 row(s) affected)
    col1
    1
    Msg 245, Level 16, State 1, Line 8
    Conversion failed when converting the varchar value 'NaN' to data type int.

  • Conversion failed when converting the varchar value to data type int error

    Hi, I am working on a report which is off of survey information and I am using dynamic pivot on multiple columns.
    I have questions like Did you use this parking tag for more than 250 hours? If yes specify number of hours.
    and the answers could be No, 302, 279, No and so on....
    All these answers are of varchar datatype and all this data comes from a partner application where we consume this data for internal reporting.
    When I am doing dynamic pivot I get the below error.
    Error: Conversion failed when converting the varchar value 'No' to data type int.
    Query
    DECLARE @Cols1 VARCHAR(MAX), @Cols0 VARCHAR(MAX), @Total VARCHAR(MAX), @SQL VARCHAR(MAX)
    SELECT @Cols1 = STUFF((SELECT ', ' + QUOTENAME(Question) FROM Question GROUP BY Question FOR XML PATH('')),1,2,'')
    SELECT @Cols0 = (SELECT ', COALESCE(' + QUOTENAME(Question) + ',0) as ' + QUOTENAME(Question) FROM Question GROUP BY Question FOR XML PATH(''))
    SET @SQL = 'SELECT QID, QNAME' + @Cols0 + '
    FROM (SELECT QID, QNAME, ANSWERS, Question
    FROM Question) T
    PIVOT (MAX(ANSWERS) FOR Question IN ('+@Cols1+')) AS P'
    EXECUTE (@SQL)
    I am using SQL Server 2008 R2.
    Please guide me to resolve this.
    Thanks in advance..........
    Ione

    create table questions (QID int, QNAME varchar(50), ANSWERS varchar(500), Question varchar(50))
    Insert into questions values(1,'a','b','c'), (2,'a2','b2','c2')
    DECLARE @Cols1 VARCHAR(MAX), @Cols0 VARCHAR(MAX), @Total VARCHAR(MAX), @SQL VARCHAR(MAX)
    SELECT @Cols1 = STUFF((SELECT ', ' + QUOTENAME(Question) FROM Questions GROUP BY Question FOR XML PATH('')),1,2,'')
    SELECT @Cols0 = (SELECT ', COALESCE(' + QUOTENAME(Question) + ',''0'') as ' + QUOTENAME(Question) FROM Questions GROUP BY Question FOR XML PATH(''))
    SET @SQL = 'SELECT QID, QNAME' + @Cols0 + '
    FROM (SELECT QID, QNAME, ANSWERS, Question
    FROM Questions) T
    PIVOT (MAX(ANSWERS) FOR Question IN ('+@Cols1+')) AS P'
    EXECUTE (@SQL)
    drop table questions

  • Need help converting quicktime movies into Flash files

    I need to convert a QT, PhotoJPEG compressed, movie file into a .flv format. I have AE 6.5 Standard and it keeps quitting on exporting a SWV file which would could probably get me by with my client. But, again, it errors out saying something like a JPG is busy, or a file is busy.
    I have FlipforMac,a purchased version. But I'm not sure if converting it into a .wmv and then a Flash file is the best route or is even possible.
    Any suggestions or ideas of software that I could purchase??
    ~reicko

    i don't think you have read up on the use of flash video
    (FLV). there's nothing you need that you do
    not already have (except maybe quicktime pro or some other
    video editing program). the FLV exporter
    comes FREE with flash 8. You should be able to open your
    quicktime movie in QT PRO and export to FLV
    format - then use any of the flash playback components for
    FLV files - best bet is to read the help
    docs on this subject and go to the devnet section of
    adobe.com where there are several in-depth
    articles about implementing flash video into your site.
    --> **Adobe Certified Expert**
    --> www.mudbubble.com
    --> www.keyframer.com
    rhian wrote:
    > Hi,
    > Thanks for your reply. I am using Flash 8. I've been
    looking into streaming
    > and it's very expensive with quicktime movies, however
    I've found a company
    > that will stream flash movies much more cheaply which is
    why I want to convert
    > it to a flash movie.
    >
    > Sorry are you say that Quicktime Pro allows you convert
    files into flash
    > formats?
    > Rhian
    >

  • Need Help Converting Video

    Hello - I have a couple of separate questions that I need help with.  I know basic FCP.  I have FCP7.  I recently shot a wedding with 2 different cameras.  Both are HiDef Cameras.  1 Camera is a Prosumer Camera where the files were taking off the camera and imported by Final Cut.  The second is a new, home camcorder which saved the files into a hard drive in MPEG 4 format.
    I need to marry the two.  I can import the all the files (from both cameras) directly into the timeline.  But the ones from the camcorder (the mpeg4s) seem to have that "hitchy" feel to them when I play them back.  Also, both types of files (even the ones that were directly imported into Final Cut from the Prosumer Camera) have the "render" lines when they are in the timeline, so I constantly have to render which takes forever. 
    The files that were imported directly into FCP from the ProSumer camera were imported on a different computer with a different version of FCP, so when I drag them into my timeline it tells me that they were from a different version and asks me if I want to update for my version.  If I click YES then it stretches the files from 16:9 to 4:3.  If I say NO then it keeps the 16:9 aspect ratio, but adds yet another layer of render I need to do.
    Normally I do simple, Standard Def edits where I import things into the timeline via FCP7 with firewire from a deck and edit directly from there, then firewire back to the deck.  Simple - no rendering, etc.  My questions are as follows:
    1 - Do I need to reset my timeline settings because I am now working with HiDef?  Or does FCP automatically know that it is HD and it doesnt matter how I drag it into the timeline?
    2 - Do I need to convert the MPEG 4 files to quicktime format, or does it not make a difference
    3 - When I export, what settings would I use to keep it in HiDef.  I am only going to make DVDs with it.
    4 - Is there a way to do it so that I do not have to render constantly while editing
    5 - To view, I am firewiring out to a deck which is then going into a Standard Def monitor.  Is that the reason the footage appears "hitchy"?
    Any help is greatly appreciated.  If you have any help, please drop me a note at [email protected]
    Thanks

    YOu need to learn how to use FCP.  Sorry, no offense needed, and I know it sounds harsh. But from reading that I can tell you have no idea about how to properly import tapeless media into FCP...and don't know what formats FCP works with...nor know what formats the cameras record.  This is all basic stuff you need to know before you edit.  Editing isn't only creative, but lately highly technical as well...you need to know what your software is capable of doing, and how to get the footage into it properly. 
    You cannot do what you did...directly drag from the cameras into FCP.  No...it needs to be imported, typically with LOG AND TRANSFER...and converted from the shooting format, which typically isn't natively editable in FCP (want native, use Adobe Premiere...).  It needs to be converted to ProRes.  And yes, the file sizes of ProRes are a LOT bigger than the camera originals.  4-5 times larger.  That's how FCP works.
    Here's a quick tutorial to get you started.  But then I suggest getting to know the editing system better.
    http://library.creativecow.net/ross_shane/tapeless-workflow_fcp-7/1

  • Need help using LabVIEW 7.1 and data socket to transfer images

    I need help transferring images across a company network using: LV 7.1, IMAQ 3.0 and a PCI 1407 image aquisition card. I am trying to use datasocket to transfer video image across a company network. I have attached sample vis. Thanks in advance for your help.
    I. Cyr
    Attachments:
    Vibration Chamber Vision_Cyr.llb ‏129 KB

    Hello –
    Something that you need to consider is the fact that when you are sending an image over Data Socket, it is not really the image what is being transferred but a pointer to the image. Please take a look into this Knowledgebase.
    Also, you might find this Example Program useful.
    Hope this helps.
    S Vences
    Applications Engineer
    National Instruments

  • Need Help Converting AVI Home Movies to Mpeg without audio and Video Delay.

    I have lots of home movies of my new baby i want to take with me while in Navy training and need help. I have tried 7 movie conversion software programs and it have cost me a lot, but none of them work. Any suggestions please? I leave soon and would like to know as soon as possible please. Thank you so much
    Converting AVI to MPEG on Windows XP OS

    YOu need to learn how to use FCP.  Sorry, no offense needed, and I know it sounds harsh. But from reading that I can tell you have no idea about how to properly import tapeless media into FCP...and don't know what formats FCP works with...nor know what formats the cameras record.  This is all basic stuff you need to know before you edit.  Editing isn't only creative, but lately highly technical as well...you need to know what your software is capable of doing, and how to get the footage into it properly. 
    You cannot do what you did...directly drag from the cameras into FCP.  No...it needs to be imported, typically with LOG AND TRANSFER...and converted from the shooting format, which typically isn't natively editable in FCP (want native, use Adobe Premiere...).  It needs to be converted to ProRes.  And yes, the file sizes of ProRes are a LOT bigger than the camera originals.  4-5 times larger.  That's how FCP works.
    Here's a quick tutorial to get you started.  But then I suggest getting to know the editing system better.
    http://library.creativecow.net/ross_shane/tapeless-workflow_fcp-7/1

  • Need help converting Client-Server to JSP

    Hi;
    I have a purely data driven, dynamic, meta driven program
    in Java 1.4. Runs on almost any SQL database, and the
    systems analysts can do most of the programming just by
    entering the data. All screens and sql are auto-genned
    at runtime.
    I was wondering if there was anyone interested in helping
    convert to JSP. I would be willing to give part of the
    company profits. It is better then me asking a million
    questions here, although there are lots of great experts here.
    -Trent
    Thanks.

    My personal email address is [email protected] I would love to contact you if you drop me your phone number.
    Manohar

  • Need help converting photo jpg to a video file.

    So I have a 6 minute animation that was sent to me as a series of photo-jpgs. I need to convert them to a video file rather than a huge sequence of stills so I can add some transitions. The images are 1920 by 1080. I don't want to compress them at all until the final render. What sequence settings should I use and how should I export? I know there a billion and two different ways to do this but for some reason I keep screwing it up.
    Jon

    As long as the images are sequentially numbered, 001, 002 etc,
    1. open up QT Pro and import as a still image sequence and save is as an animation codec.
    2. create a sequence using the animation codec as the basis, import all the images and drop them into the timeline.
    Recognize that the animation codec requires a huge bit of horsepower and disk throughput to edit in real time.
    x

  • I need help converting date interger in string.

    I am a beginner if you can even say that..... But to the point I'm using Dreamweaver and I'm pulling data from my database and it's being displayed on my webpage. Currently the code below pulls the month from the database as a number. I would like it to pull the date and change it from a number to it corresponding abbreviated month. ( ie. if it pulls 12-01-11 I need the 12 to be displayed as DEC on my website.) any help is much appreciated.
    <?php echo $row_frt_summary['month']; ?>

    You can do it either in SQL or PHP,
    For MySQL, use the date_format function with the %b specifier:  http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-format
    For PHP, use date_fomat with the M format character: http://www.php.net/manual/en/function.date-format.php
    Also, PHP, SQL and application development questions should be posted in the app dev forum.

Maybe you are looking for

  • Items is a region displayed after a sql report region!

    Hello everybody! I have 3 regions : 1/ HTML text region with some items : sequence 10, column1 2/ SQL report region : sequence 20, column1 3/ HTML text region with some items : sequence 30, column1 I have many problems and errors when submitting the

  • S-video and GeForce 8800

    Hello! Been over this with my local Apple resaler and Apple over phone. I have recieved and tried with both the old modell and new modell og DVI to Video Adapter (MA026ZM/A and M9267G/A), and none of them give me no video. Any suggestions? The goal i

  • F110 - payment medium generation too fast ?

    Hello I want to share with you a new behavior we are having from time to time with F110 automatic payment. we are generating a payment medium (SEPA_CT). Sometime SAP can not generate the payment medium file, saying it can not find the FI document (th

  • Find & Move files based on csv headers

    Hi Everyone, Basically, I am trying to find locations for those files listed in a csv file. Content of the csv file is shown below: Name, filename1.xlsx, filename2.xlsx, filename3.xlsx, And this is my code but I couldn't get it to work!! $csv=import-

  • Dreamweaver cannot upload files larger than 2gb to remote site

    I am uploading a set of large video files to a remote site at the University of Connecticut.  I have no problem doing this through Cyberduck. I can also upload (put) files to the  through Dreamweaver provided that the files are smaller than 2gb.  Dre