Why does TO_CHAR not like me adding a fraction then specifying FF?

Why does TO_CHAR not like me adding a fraction?
SQL> SELECT TO_CHAR(TO_TIMESTAMP('1/1/2012', 'DD/MM/YYYY') + .733409047, 'HH24:MI:SS') FROM Dual;
TO_CHAR(
17:36:07
SQL> SELECT TO_CHAR(TO_TIMESTAMP('1/1/2012', 'DD/MM/YYYY') + .733409047, 'HH24:MI:SS.FF') FROM Dual;
SELECT TO_CHAR(TO_TIMESTAMP('1/1/2012', 'DD/MM/YYYY') + .733409047, 'HH24:MI:SS.FF') FROM Dual
ERROR at line 1:
ORA-01821: date format not recognized
-- NUMTODSINTERVAL() saves the day.
SQL> SELECT TO_CHAR(TO_TIMESTAMP('1/1/2012', 'DD/MM/YYYY') + NUMTODSINTERVAL(.733409047, 'DAY'), 'HH24:MI:SS.FF') FROM Dual;
TO_CHAR(TO_TIMESTA
17:36:06.541660800

Hi,
Date arithmetic only works with DATEs.
If you want to do something similar with TIMESTAMPs, use NUMTODSINTERVAL:
SELECT  TO_CHAR ( TO_TIMESTAMP ('1/1/2012', 'DD/MM/YYYY') + NUMTODSINTERVAL (.733409047, 'DAY')
          , 'HH24:MI:SS.FF'
FROM      dual
;Here's exactly what's happending:
When you say "d + n", d is supposed to be either a NUMBER or a DATE. When you pass any other datatype, Oracle tries to convert d to either a NUMBER or a DATE. In this case, d was a TIMESTAMP; Oracle realized that it could convert that TIMESTAMP into a DATE, and did so. The 1st argument to TO_CHAR, therefore, was a DATE, but '.FF' only works with TIMESTAMPs.
There are a couple of things about how Oracle handles this that I find annoying, but I don't know of any better work-around.
Edited by: Frank Kulash on Feb 16, 2012 1:39 PM

Similar Messages

  • Why does iCloud not like Ed Sheeran and why is iTunes a liar?

    So like everyone on here I'm sure, you've downloaded iOS 7. I had some difficulty but have it on my phone now and even through my cracked screen it's beautiful. BUT
    Before I updated my iPhone, i installed the latest version of iTunes on my Macbook Pro. My first problem is after both devices were updated, my iTunes is saying it cannot connect to my iPhone because it doesn't have the latest version. I've quit and restarted iTunes and have restarted my macbook a couple of times but I keep getting that error message.
    So that's my first problem.
    The other problem is friggin iCloud on my iPhone! Most of my purchased music downloaded on there no problem. I didn't mind when it came to most of my music because i haven't listened to most of it. But it won't download Ed Sheeran's album which I listen to quite often lately. Soooo this is most definitely a problem.
    I really hope someone can help me on here because I am NOT paying $19 for tech support. Thanks!!!

    It is not Mac to Mac.
    Why not look up iCloud support, it was never offered as anything outside iOS 5 supported devices.
    Maybe if you would stop reading into things what isn't there.
    https://discussions.apple.com/community/icloud?view=overview
    http://www.apple.com/support/icloud

  • Why does FF not like my menu ?

    I am drafting a web site, and for some reason FF does not
    recognize my
    menu. IE funny enough does.
    What the heck am I missing?
    http://anuragdesign.com/test/cd/test_layout.php
    Aji - *blindasabat*

    Anuragbabaji wrote:
    > I am drafting a web site, and for some reason FF does
    not recognize my
    > menu. IE funny enough does.
    >
    > What the heck am I missing?
    >
    >
    http://anuragdesign.com/test/cd/test_layout.php
    >
    > Aji - *blindasabat*
    Heureka! The culprit was identified.
    In the sequence of the layout I originally designed it that
    the content
    comes before the sidebar in the source code. Some time later
    on I must
    have moved it in the HTML. Moved back, it works again...
    So I guess the error was a combination of the negative
    margins and the
    Cascading nature of CSS...
    * Pheew *

  • Why does safari not like the letter N?

    Hi, can anyone help?
    I know somewhere along the line I have done something wrong, but I just can't figure out what!
    I'm responsible for the website: www.gmvg.co.uk. (I try my best, but I'm just a novice)
    When I print (or print preview) pages from this website using Safari (for Windows) if the capital letter N is in the heading it doesn't appear? (e.g. the NEWS page just shows " EWS" or events page just shows "EVE TS")
    Take a look at the following pages to see what I mean:
    http://www.gmvg.co.uk/news.php
    http://www.gmvg.co.uk/events.php
    http://www.gmvg.co.uk/contact.php
    Can anyone offer any advice (it only appears to be a problem on my website, in the Safara browser - IE, Firefox, Chrome, Opera and Flock work fine).**
    Many Thanks,
    Simon.
    Message was edited by: sjulou

    Well I had someone with a Mac print some pages from my website (via Safari) and they +*did not*+ have the problem with captial Ns in headings not showing.
    I then had someone with a Windows machine print some pages (via Safari) and he too +*did not*+ have this problem.
    I'm therefore assuming (and hoping) that it's only a problem with my machines and it's not something I have done (wrong) on the website.
    I've tried searching the internet for a solution without any luck and I've tried looking into various settings on my computer (again without any luck).
    Basically I'm now out of ideas, any advice from people on here would be most welcome and once again thanks to Andy for all his help!
    Regards,
    Simon.

  • Why does brasero not burn a DVD?

    I have a DVD to burn, but every time I run Brasero I get a message to insert an empty disk or otherwise it will attempt to make an image. With the empty disk inserted seems like brasero does not see the device and disk.
    With my external DVD writer connected I can't burn anything to it. The user is added to optical group and the device is found. Growisofs however works with the provided path. Why does brasero not see the writer and how do I make it burn the dvd?
    Last edited by tasty_minerals (2012-07-22 23:04:14)

    A likely cause of this error is that some program did not report memory usage correctly to the OS.
    This ARTICLE will give tips on finding "clues" as to what was happening at that moment. Chances are good that that program, or Process is identified somewhere in the Event Viewer. Now, be prepared to do a bit of reading, but follow EVERY link in any of the error, or warning messages.
    Good luck,
    Hunt

  • Why does 'User not registered for online use' show up when I try to import a cd into itunes. None of the cd info shows up either

    Why does 'User not registered for online use' show up when I try to import a cd into itunes? None of the cd info shows up either.

    Well, the format I upload from the camera is "video clip" or "video for Windows"...sometimes I've converted them to avi format, too. But as I said, it never even lets me get that far...I never get to even select a clip. As soon as I tell the program to "import/clip" it freezes up before I can even go to the folder that the clips are in. It has only begun to do this recently, and I'd never had any problems like this before. Last night I tried it again, and I clicked "open composition", and it froze when I did that too.
    I'm not sure how much more specific I can be about the details of the clips, since I'm positive it has nothing to do with the clips themselves...I'm running Windows XP, though...Home Edition Service Pack 2, Pentium 4 CPU 2.80GHz, with 504 MB of RAM. I have had the automatic updates turned on since I did my last reformat a couple of weeks ago. Could it have something to do with some kind of an update it may have done?

  • HT204406 I have subscribed to match on iTunes and organized my music on my Mac Book.  Why does it not appear the same way on my iPad

    I would like my music to appear organized in the same way on my iPad as I have done it on my Mac Book.  (and on my iPhone as well)  Since it is in the cloud, why does it not appear the same way in all devices?

    The purpose of iTunes match is to make your music library available to all of your devices anywhere. It will sync Playlists, but no other type of organization you may have made.
    If you're having trouble, be sure you are logged into the same Apple ID on all devices but be sure to read this article and pay special attention to associating your devices with an Apple ID. There are important restrictions you should know about.

  • I just bought more icloud storage, why does it not let me backup my iPhone 5..says i need 1.4 GB of space

    i just bought more icloud storage, why does it not let me backup my iPhone 5..says i need 1.4 GB of space?..I just bought 10 more in icloud.

    I think you are confused. Syncing apps and music to your phone will not get store in the cloud by adding more cloud storage. If you don't have enough space to sync the music and apps, buying cloud storage won't help. If you have a 16GB phone, the phone still only has 16GB for apps and music even if you buy 10 mor GB of cloud storage.

  • Why does cellular not support phone features?

    iPad Mini with Retina display has a celluar capability. Why does it not support full phones features, doubling as an iPad and phone like the iPhone 5S does?

    And I don't mean to seem rude. I have worked in product development many years with a very large company. I have also challenged engineers and developers to look beyond the basics to deliver something that sets the trend adn differentiates itself from the pack.
    Apple as that trend-setter created awesome products in the form of the iPad Air and the iPad Mini w/ RD. It is extraordinary in the leading technologies they incuded in the  package. It would have been BRILLIANT though, to have converged both as an IPad and a phone. It would have propelled the iPad light years ahead of the competition.

  • After Effects CC 2014 will not upgrade?  Gets to 100% and then says application failed.  Why does this not upgrade?

    After Effects CC 2014 will not upgrade?  Gets to 100% and then says application failed.  Why does this not upgrade?

    We can't know anything. You have not provided any useful details like system information or the install logs.
    Mylenium

  • Why does quicktime run like crap?

    Why does quicktime run like crap, skips frames like crazy? If I install xvid codecs instead and play the movies in windows media player they play without a glitch. Why is that? I'm must say I'm not impressed with the first apple software I've tried. Also another annoying thing... I don't want iTunes and all the other crap with it! Just quicktime. Also almost all the menu's are blocked with pro upgrade.... do apple customers have to buy quicktime pro as well?

    Impossible to say, "allp", without knowing anything about your system, the version of QT you're running, nor the movies you're trying to play and from what medium you're playing them. QT movies work just fine on my Dell Dimension 8200 (specific specs on request).
    You can download QuickTime alone, without iTunes, here.
    And yes, the menus involved with editing and exporting will almost all be nonfunctional until you buy the Pro upgrade. And it's the same with Macs as with Windows; we all have to purchase the Pro upgrade to get that functionality.

  • Why does Canon NOT support the Canon Utilities software?

    The Canon Map Utility software can not detect my Canon GPS Receiver GP-E2.  Over the phone, Canon "Customer Support" had me uninstall all 10 Canon Utilities that I had previously installed, and then let me install only 8 older versions of Canon Utilities.  And, the Canon Map Utility software STILL could not detect my Canon GP-E2. 
    Why doesn't Canon have ANYONE who knows the Canon Utility software?  The first support rep had NEVER used any of the software!  And the second support rep, whom I was transfered to by a Supervisor who told me that this was the most experienced support person for the software, has only used the software ONCE!
    Why does Canon NOT SUPPORT Canon software?????
    As an old friend used to always say,
    "Keep Looking Up!"
    Calen

    When I use the GPS-E2 on my camera, the pictures have are geotagged.  It's when I try to use the GPS log that Map Utility has a problem.  I like the idea of recording where I went, not just where each picture was taken.  That way, I can see where I found nothing to take pictures of.
    Calen
    As an old friend used to always say,
    "Keep Looking Up!"
    Calen

  • Refresh DSV - why does it keep indicating it "Added" things, when its already been done? (repost from DW forum)

    Note to moderator(s):
    Please remove the other post
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/d4e30da8-5234-4373-963f-c165b99f8df2/bids-2008-refresh-dsv-why-does-it-keep-indicating-it-added-things-when-its-already-been-done?forum=sqldatawarehousing
    There were a number of changes done and earlier I had used the "refresh" button in the DSV view, and the updates were reflected in the DSV.  Now, however everything should be updates, yet when I hit refresh, the dialog still comes up and list
    all the changes it did earlier as "Added".  What is going on here?
    Now however, all my tables, dimensions, relations etc are setup with no errors and the cube builds, processes and deploys without any errors, yet if I refresh the DSV, I still get the dialog that displays all the things that it "sees" as "Added".
     This is even after closing down BIDS and re-opening.
    Also, I wonder if this has something to do this this thread, since its concerning the DSV getting "confused"
    https://social.msdn.microsoft.com/forums/sqlserver/en-US/33918238-cbe0-4017-bec9-0fe1bad15909/refresh-dsv-gives-net-error-column-argument-cannot-be-null

    Hi Shiftbit,
    According to your description, you need to know why the dialog still comes up and list all the changes it did earlier as "Added" when there is nothing changed in the data source view, right?
    I have tested it on my local environment. We use the sample project AdventureWorks, we didn't make any modification on the DSV and click the Refresh button, and all the changes were list on Refresh Data Source View dialog. So as per my understanding, this
    is default settings. If we click the button, it will list all the changes from the date when you create this project.
    If you have any concern about this behavior, you can submit a feedback at
    http://connect.microsoft.com/SQLServer/Feedback  Your feedback enables Microsoft to make software and services the best that they can be.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Why does IBA not include the table of contents when exporting to PDF?

    Why does IBA not include the table of contents when exporting in PDF? I can seee the TOC in iBooks Author but when I want to see what it looks like in a regular PDF, the TOC does not show up.

    Strange question you ask here. Not sure why that is relevant to "why" IBA won't publish a table of contents in a PDF.
    But since eyou asked, it's simple, I want to author some books in IBA and also see what they look like - completed - in PDF. Again, any suggestions as to a work around so I don't have to cut and paste back into Pages?

  • Why does iCloud not sync mail rules?

    This seems like a no brainer. When I view my email on my Iphone, I see all my Spam, which would already be dispatched to the Junk box on my desktop, had I looked there first. Why does iCloud not sync my Mail rules, and is there a solution for this?

    It is not Mac to Mac.
    Why not look up iCloud support, it was never offered as anything outside iOS 5 supported devices.
    Maybe if you would stop reading into things what isn't there.
    https://discussions.apple.com/community/icloud?view=overview
    http://www.apple.com/support/icloud

Maybe you are looking for

  • Kernel panic every time I try to backup

    I am running Mac OS X 10.8.4. I bought the newly released 3TB Airport Time Capsule two days ago. After installing Parallels, my disk became corrupted and using the Option key during start up to access the disk repair utility was not successful - the

  • Automatic clearing bank GL accounts

    hi friends, we have a problem with automatic postings today we are getting bank statements from the bank for the salaries payments we have made, Automatic clearing is happening when we are receiving the bank statements it is clearing the bank clearin

  • SOAP Receiver

    Have an issue with new dev SOAP Receiver: Connection times out with the below error SOAP: call failed: java.net.SocketException: Connection timed out:could be due to invalid address Connection is open and we can telnet the external server and also we

  • Account group Search

    Hi, I have a problem here. I am using Account_group field to use as a search field in Accounts application. I only get results for Rh SOld to party, watever be the choice for the account_group. Please let me know if u have any idea. Thanks

  • Can XDODTEXE produce BI Publisher output?

    Greetings, I have used BI Publisher to produce a report in Excel that outputs to multiple tabs in Excel xls when executed on the desktop. When I move the rtf Template file and xml Data Definition file to the server and use the XML Publisher Data Temp