How do i convert a portion of day into a time?

How do i convert a portion of day into a time, without dividing and modding the number myself?
For example, i calculated solar noon UTC to be .733409047. Adding that to the date gives the correct answer:
SQL> SELECT TO_DATE('1/1/2012', 'DD/MM/YYYY') + .733409047 FROM Dual;
TO_DATE('1/1/2012',
01/01/2012 17:36:07
A few questions, to actually understand this.
Is .733409047 implicitly converted? If so, to what datatype?
If i want HH:MM:SS does it need to be converted to a date, and then TO_CHAR? Or can the decimal be directly converted?
I'm currently trying to understand INTERVAL.
SQL> select interval '.5' day from dual;
select interval '.5' day from dual
ERROR at line 1:
ORA-01867: the interval is invalid
So, i'm obviously misunderstanding it. Can it be used here?

Hi,
Brian Tkatch wrote:
How do i convert a portion of day into a time, without dividing and modding the number myself?
For example, i calculated solar noon UTC to be .733409047. Adding that to the date gives the correct answer:
SQL> SELECT TO_DATE('1/1/2012', 'DD/MM/YYYY') + .733409047 FROM Dual;
TO_DATE('1/1/2012',
01/01/2012 17:36:07
A few questions, to actually understand this.
Is .733409047 implicitly converted? If so, to what datatype?No, there is no conversion going on here, just Date Arithmetic .
In Oracle, if d is a DATE and n is a NUMBER (not necessarily an integer, and not necessarily positive), d+n is the DATE that is n days later than d.
If i want HH:MM:SS does it need to be converted to a date, and then TO_CHAR? Or can the decimal be directly converted?Sorry, I don't understand. Are you saying that you want to do something like date arithmetic, but instead of using a number like .733409047 (meaning about .73 of a day), you want to pass a string like '17:36:07' (meaning 17 hours, 36 minutes and 7 seconds)? If so, INTERVAL DAY TO SECOND is probably your best bet. (It looks like you're already thinking along these lines.)
I'm currently trying to understand INTERVAL.
SQL> select interval '.5' day from dual;
select interval '.5' day from dual
ERROR at line 1:
ORA-01867: the interval is invalid
So, i'm obviously misunderstanding it. Can it be used here?You can only use integers like that. If you want to use any number, then use date arithmetic to add to (or subtract from) a DATE, or use NUMTIDSINTERVAL to produce an INTERVAL DAY TO SECOND:
SELECT     NUMTODSINTERVAL (.733409047, 'DAY')     AS intrvl
FROM     dual;Output:
INTRVL
+000000000 17:36:06.541660800 
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements), maybe about 5 rows, and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using.

Similar Messages

  • 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

  • How can I convert a PDF/A file into a PDF file with Acrobat Pro X?

    How can I convert a PDF/A file into a PDF file with Acrobat Pro X? I'd like to modifiy the file which I have only as a PDF/A.

    There's two answers if you want to modify the file:
    You can temporarily turn off PDF/A Mode in your preferences, so they don't open as read-only. The problem would be if you do something to the file that violated the PDF/A standard, so you should always run a Preflight check afterwards to make sure.
    If you want to remove the PDF/A header tag, use Preflight again - it's on the Print Production Panel in Acrobat X Pro (which may be hidden, use the options menu on the Tools Pane to show it). There's a profile called "Remove PDF/A information" - choose this and press Analyze and Fix. Nothing else about the file will be altered but when you save and reopen it all the editing tools will become active.

  • How do I convert a WHOLE PDF file into jpeg on LION?

    how do I convert a WHOLE PDF file into jpeg on LION?  I know how to open it in Preview but there is no longer an option through Print and if I export it only allows one page at a time and I need 223 pages...

    Use this Automator Action:

  • How can I convert a secure pdf document into word?

    How can I convert a secure pdf document into word?

    Hi,
    Please refer to below mentioned article:
    http://forums.adobe.com/docs/DOC-1515
    ~PRanav

  • How do I convert a shockwave object file into a mp4 or avi video?

    How do I convert a shockwave object file into a mp4 or avi video?  Do you know of any software that converts that type of file?  

    The M4V format is a video file format developed by Apple and is very close to the MP4 format. The differences are the optional Apple's DRM copyright protection, and the treatment of AC3 (Dolby Digital) audio which is not standardized for the MP4 container.
    If your M4V video is not unprotected M4V files and without AC3 audio. It may be recognized and played by other video players by changing the file extension from ".m4v" to "mp4".
    So you can try to change the file extension and check if it works. If it doesn't work, try Leawo video converter(for windows or mac) and convert m4v to mp4 format.

  • How do i convert my scanned jpg images into word

    How do i convert my scanned jpg images into word

    No, Acrobat Pro is expensive
    95% of all the professional scanned in books are in PDF, the entire structure and countless years of work have gone into Acrobat being not just the "best" standard for scanned books, but really the ONLY standard for them.
    Yes, many many little programs can convert to PDF after you have them in a file, or even from Safari you can "print as PDF" or "save as PDF"
    however it just saves them as PDF, and you can use Acrobat READER for free,....
    but Reader is just that, a reader, you cannot do pro editing, scale down the file size etc etc, signatures, portfolios etc.
    Ive got a 42 Terabyte collection of PDF books,.....Ive spent too much time staring at PDF books   LoL.

  • Howe to I convert my I Tune files into MP3 or WAV files

    how to i convert my I Tune files into MP or WAV files

    Hi Bodenlaube,
    Thanks for visiting Apple Support Communities.
    See the tips in this article for help:
    iTunes: How to convert a song to a different file format
    http://support.apple.com/kb/HT1550
    Cheers,
    Jeremy

  • How does one convert an HP/Adobe scan into editable WordPerfect?

    How does one convert an HP/Adobe scan into editable WordPerfect? 
    The writer does not understand computer-eze.  Please explain in simple English.

    You can try using Adobe ExportPDF (https://www.acrobat.com/exportpdf/en/home.html) though it only produces Microsoft Word files. If WordPerfect can import .docx files, that will work. Note that the ability for ExportPDF to convert the file depends on the quality of the scan. If it's hard for ExportPDF to interpret the scan due to smudges, fuzziness, etc., it cannot do a very good job.

  • How to backup an external hard drive plugged into a time capsule using time machine

    How to backup an external hard drive plugged into a time capsule using time machine.
    I want to move my itunes library from the mac HD to an external plugged into the time capsule, but I want to be sure this drive will still be backed up by time machine.  I currentlly see no way to do this.

    There is no way. You can connect the drive to your Mac and remove it from the Time Machine exclusion list. Then it will be backed up, but that will stop when you reconnect it to the TC. While it's connected to the TC, you can copy it manually to another AirPort Disk by following the instructions here (with a slight modification):
    Using AirPort Utility to make a copy of the Time Capsule disk

  • How can I convert an audio file (speech) into a text?

    Hello everybody!
      Can someone explain how I can convert a garageband file (voice speech) into a text? My Mac is a Mac OS X 10.5.8 version, so I don't have programs such as mountain Lion. I thought to use googlevoice. Is this option available? If yes, how can I use it?
    Thanks.

    Hello, I only find google voice available for Abdroid!?
    http://www.ehow.com/info_10033225_google-voice-system-requirements-android.html
    Some possibilitities, not sure if they have 10.5.8 compatble versions anymore...
    http://atmac.org/speech-to-text-dictation-software-for-os-x
    Some reviews of later Dragon Speak...
    http://www.finetunedmac.com/forums/ubbthreads.php?ubb=showflat&Number=22962

  • How can I convert an array off byte into an Object ?

    Hi folks...
    I�m developing an application that comunicates a PDA and a computer via Wi-Fi. I�m using a DataStream ( Input and Output ) to receive / send information from / to the computer. Most off the data received from him is in the byte[] type...
    How can I convert an array off byte ( byte[] ) into an Object using MIDP 2.0 / CLDC 1.1 ?
    I found on the web 2 functions that made this... but it uses a ObjectOutputStream and ObjectInputStream classes that is not provided by the J2ME plataform...
    How can I do this ?
    Waiting answers
    Rodrigo Kerkhoff

    There are no ObjectOutputStream and ObjectInputStream classes in CLDC. You must know what you are writing to and reading from the DataStream. You should write the primitives like int, String to the DataOutputstream at one end and read those in exactly the same sequence at the outher end using readInt(), readUTF() methods.

  • How do I convert multiple sheets in excel into one pdf document?

    How do I convert multiple sheets (tabs) in excel to one combined pdf document?

    Hi Ptizer,
    If you have Acrobat PDFMaker  enable on Ms Excel. You can click on Create PDF.
    And choose settings as highlighted on screen shot it should do the job for you.
    Regards,
    Ajlan Huda.

  • How do I convert my .mpeg /  .bat files into ones compatible with iPod ?

    I know its a basic question but I want to find out as a new user of iPod Video as to how i can convert .mpeg and .bat files to ones which are compatible with iPod ?

    Hi Ravindra,
    welcome to this forum
    iMovie is an edit app...
    you raise the chance to get an answer to your specific question by posting here:
    http://discussions.apple.com/forum.jspa?forumID=808
    besides: converting mpgs or even .bat files ISN'T basic ... ;-))

  • How do I convert a 25fps shot film into a 1920x1080px@50fps quicktime/photojpeg or h.264

    Hello,
    I shot a film with a canon 5d mark II (25fps) and cut it on Final Cut Pro. Now I've been told, they need 920x1080px@50fps as quicktime/photojpeg or h.264 with high Bitrate. How do I convert my video into that using either Final Cut or Compressor or both?
    Thanks

    In the Compressor Inspector, in the Video tab, under Video Properties, you can change the size. There is a Change QuickTime Settings button where you can change frame rate.
    Russ

Maybe you are looking for