Timestamp difference issue

Hi,
I get blank result when I select a difference between 2 timestamps with one or more aggreagate function.
example :
create table EHTest (colA timestamp(3));
insert into EHTest (colA) values (sysdate) x 5
select min (colA), max (colA), min (colA) - max (colA) from EHTest
result :
27-JUN-06 12.07.31.000000000 PM     27-JUN-06 12.07.41.000000000 PM '     '
select sysdate - max(colA) from EHTest
result :
DB = 9.2.0.6
SQL developer version 1557
Thanks,
Regards
Eric Henrard

A late response and not from the SQL Developer team, but I tried this in SQL*Plus, and I got the following results for the queries:
select min (colA), max (colA), min (colA) - max (colA) from EHTest;
06-JUL-06 12.57.22.000 PM 06-JUL-06 12.58.01.000 PM -000000000 00:00:39.000
select sysdate - max(colA) from EHTest;
+000000000 00:04:46.000
I would guess that this is a problem with how SQL Developer is displaying interval values, because unlike date/datetime arithmetic (which returns number values for these types of expressions), timestamp arithmetic returns interval values (of INTERVAL DAY TO SECOND by default).
If I try the following query (which returns 1 day as an interval value):
select ( sysdate - ( sysdate - 1) ) day to second from dual;
I get +000000001 00:00:00 in SQL*Plus and blank in SQL Developer.

Similar Messages

  • TIMESTAMP difference issues

    I am trying to offset a timestamp column value by 6 hours some how the milli seconds is getting dropped off.
    select to_timestamp ('04/15/2008 07:17:20:485749','MM/DD/YYYY HH24:MI:SS:FF') - 6/24 from dual
    Output is 4/14/2008 1:17:20AM
    but I am expecting Output as 4/14/2008 1:17:20:485749 AM

    OrionNet wrote:
    Hello,
    Is this works for youIt will not. First of all, look at:
    'MM/DD/YYYY HH24:MI:SS.SSSSS'SSSSS is number of seconds past midnight. But most important, adding/subtracting number from a timestamp forces date arithmetic. As the result, timestamp is implicitly converted to date and fractional part of a second will be lost:
    SQL> SELECT TO_CHAR (TO_TIMESTAMP ('04/15/2008 07:17:20:485749',
      2                                'MM/DD/YYYY HH24:MI:SS:FF'
      3                  )
      4                  - 6 / 24,
      5                  'MM/DD/YYYY HH24:MI:SS.FF'
      6                  )
      7  FROM DUAL
      8  /
                    'MM/DD/YYYY HH24:MI:SS.FF'
    ERROR at line 5:
    ORA-01821: date format not recognized
    SQL> SELECT TO_CHAR (TO_TIMESTAMP ('04/15/2008 07:17:20:485749',
      2                                'MM/DD/YYYY HH24:MI:SS:FF'
      3                  )
      4                  - 6 / 24,
      5                  'MM/DD/YYYY HH24:MI:SS'
      6                  )
      7  FROM DUAL
      8  /
    TO_CHAR(TO_TIMESTAM
    04/15/2008 01:17:20
    SQL> alter session set nls_timestamp_format='mm/dd/yyyy hh24:mi:ss.ff';
    Session altered.
    SQL> ALTER SESSION SET NLS_DATE_FORMAT='mm/dd/yyyy hh24:mi:ss';
    Session altered.
    SQL> SELECT TO_TIMESTAMP ('04/15/2008 07:17:20:485749',
      2                'MM/DD/YYYY HH24:MI:SS:FF'
      3  )
      4  - 6 / 24
      5  FROM DUAL
      6  /
    TO_TIMESTAMP('04/15
    04/15/2008 01:17:20
    SQL> You need to use interval:
    SQL> SELECT TO_TIMESTAMP ('04/15/2008 07:17:20:485749',
      2                'MM/DD/YYYY HH24:MI:SS:FF'
      3  )
      4  - INTERVAL '6' HOUR
      5  FROM DUAL
      6  /
    TO_TIMESTAMP('04/15/200807:17:20:485749','MM/DD/YYYYHH24:MI:SS:FF')-INTERVA
    04/15/2008 01:17:20.485749000
    SQL> SY.

  • Timestamp Difference Excluding the weekends

    Hi,
    I need to find the Timestamp difference from Monday to Friday by Excluding the Weekends..
    At present I am using the Timestamp diff function to find difference but let me know how to exclude the weekends from the calculation..
    Is there any function to exclude.. Please help me..

    Hi,
    There is no direct function available in OBIEE to exclude weekends (SAT and SUN) while you do a day difference calculation.
    In order to achieve this, there are two ways...
    1. Create a complex join with W_DAY_D table with the condition W_DAY_D.DAY_DT in between OPEN_DATE and ifnull(CLOSE_DATE, current_date) and W_DAY_D.DAY_OF_WEEK not in (1, 7). This will give you all the records from W_DAY_D between OPEN_DT and CLOSE_DT excluding Saturday and Sunday. Then you can create a metric in BMM layer to count the ROW_WID from W_DAY_D table. The count gives you the desired value.
    2. Move the OPEN_DT and CLOSE_DT to the Friday by adding the desired number of days using TimeStampAdd and DayOfWeek function. Calculate the day difference between OPEN_DT and CLOSE_DT(say X) and calculate the week difference after modifying the dates to friday (say Y). Now X-2*Y is going to give you the desired value.
    Hope this helps.
    Thanks,
    Santosh

  • Timestamp datatype issue in Expression

    Hi
    I am extracting data from oracle table which timestamp datatype for one column then connected to Expression operator. When i see the data type of timestamp in sourcetable it is timestamp(3), But when i see the data type of timestamp in Expression operator it says timestamp(3) but it is adding 6 in the precision by default and that cannot be changed. I tried creating new column in expression it behaved the same. there by my mapping is giving me the warnings regarding this.
    Could you guys please help on this.
    Thanks

    Hi Cezar,
    Thanks for your quick reply.
    I am currently doing the second step you have mentioned. I even went to the extent of cutomizing the I$ tables getting created with a custom structure to avoid this. But this is very tedious as i have hundreds of columns in the table.
    Is this a bug in ODI? I am asking this because this is a general functionality and should be ideally covered by such a good ELT tool.
    I have raised a SR for the same, let us see what solution they have in store:)
    Anyway thanks for your valuable suggestion its really useful.
    But I have a doubt regarding the versions. Whats the difference between versions 10.1.3.2.0 which I am using and 10.1.3.4.0? I hope this version is not creating this issue?
    Thanks,
    Vikram

  • Exchange rate difference issue

    Hi SAP Gurus,
    My client is facing one issue while receiving one payment in foreign currency.  User is posting payment through F-28.  Document currency is GBP and Local currency is EUR.   Excharge rate maintained in OB08 for GBP to EUR is 1.22137.
    It is working fine for first five cases as showing below but for for sixth case system is showing wrong amount 4,968.30-
    instead of 7646.58 in the document and the difference 2,678.28-  is posting in Real.exchange gain local account in separate line. 
    278012   40          278012               38,682.10    47,245.16
    1000029  15          198000                     3,133.26-    3,826.87-
    1000029  15          198000                     4,352.00-    5,315.40-
    1000029  15          198000                        244.04-      298.06-
    1000029  15          198000                      3,823.77-    4,670.24-
    1000029  15          198000                     20,868.38-   25,488.01-
    1000029  15          198000                      6,260.65-    4,968.30-
    828001   50          828001  Real. Exch.Gai         0.00     2,678.28-
    828003   50          828003  Real. Exch.Gai         0.00         0.00
    Does anybody knows why system is behaving like this.  Many thanks in advance for your kind help.
    Regards,

    Are these the open items in one invoice or open items in different invoices? If they are in different invoices, you can check whether some invoices are not using currency GBP but other foreign currencies?
    I met some case that if the invoice was posted in a different foreign currecy and in different payment period. The system will translate among 2 foreign currencies and local currency.
    Good luck.
    Emma

  • Date difference issue for Purchase order in R/3 and APO

    Hi,
       I am sending the purchase order from APO to R/3. When I transfer the data through CIF and see the curresponding entries in stock requirement list in R/3, purchase order is 1 day earlier than in SCM.
    However, when this purchase order is CIFed back to SCM, date appears correct in SCM ( as what it was before). Is this something because of timezone that difference in date appears in SCM and R/3.
    Can someone who came across date issues for transaction data transfer between SCM and R/3 elaborate in more detail please.
    Thanks,
    Sanjay

    Hello Somnath ,
    I am also facing the same issue which sanju was facing earlier in PRs .
    In APO I am not able to understand how system calculates the opening , start and end date .In my case the transportation time is 48 hrs , planned delivery time is 1 day and all calenders are 5*24 , GR proceeeing time .01 day . When I am creating PR at destination location on 06/06/2008 , 24:00:00 Hrs . System calculates the dates as follows :-
    Start date -06/05/2008 , 00:45:00 , end date -06/06/2008, 24:00:00 , opening date -05/20/2008 ,23:25:00 Hrs  . I tried to understand the formula given by you in your reply as Opening Date = Requirement Due Date - GR Time - Planned Delivery Time
    Start Date = Requirement Due Date - GR time - Transportation Duration
    End date = Requirement Date.
    But I am not getting the desired results.
    Could you let me know why the system is behaving in such way.I also want to know does system can create orders in such a way the opening date lies in past. If yes then can we restrict that ?
    Regards ,
    Mukesh
    Edited by: Mukesh  Kumar on Mar 9, 2008 1:59 PM

  • N8 Anna browser differences / issues?

    A couple of things I've noticed since the Anna upgrade, WRT the browser.
    1. When entering text in text windows for some forum posts (it actually works correctly on this forum, but on others I read / post to) the newline button doesn't add a line break. It did using the browser in PR1.2, can't remember the behaviour in PR1.1.
    2. When using the PR1.2 browser, I used to double tap on the screen to zoom, which worked very well. This seems to work quite differently in Anna.
    Both are notable issues / irritations for me. I suspect 1 is a big / issue - whether 2 is expected or planned behaviour, or not, though I'm unsure.
    Truth be told, I've not found anything hugely positive about the upgrade to Anna - all it's brought me is irritations in the differences or things that work differently. Performance and stability seem the same to me - which is to say that it's been good before and after Anna. The difference in look and feel just makes me feel meh. I don't mean to be overly critical, I kind of expected more from it, really.
    My N8 (admittedly this is my 2nd - first encountered the bug where it won't charge, nor turn on) has been well behaved, performs well and is stable. Main irritations have been with things like WiFi access being, well, unreliable and flakey - and seemed to be best served with scanning turned off, and WiFi power saving on. Post Anna, that hasn't improved, WiFi is still flakey, and not fully reliable (and there is context, there, I've got plenty of other WiFi devices that are stable, including other mobile phones).
    Photo viewer no longer picks up on all my photos any more since Anna (I'd have to move other folders, that worked just fine before Anna). Browser I've not found any benefits, and merely negatives. Portrait qwerty  means nothing to me, as I find the landscape one tricky enough to get key presses accepted accurately. Video player seems no better (still no bookmark facility).
    3.06 of maps seems the golden release - every beta since has been awful, one way or another - too much removed or configuration options removed, and the app dumbed down (3.08 betas). I've tried 3.07 and both 3.08 releases and in all 3 cases have reverted to 3.06 once I became sufficiently irritated that functionality that I wanted or wanted to configure better had either been removed, or was no longer configurable.
    Not sure what's going on with N8 software, but I'm considering imposing a software freeze on myself, because it seems that newer releases are doing nothing more than irritating me in not addressing things that need addressing, and merely tweaking look and feel, and dumbing everything down to make it less of a well usable device.

    laffcarl wrote:
    Well put
    Another Browser issue entering text into forums, that has stopped me using one of the only sites I used to frequent before 'AnnaUpdate!', has the strange effect of sending a line of 'Question marks and maybe the odd square box? (Have tried all font settings)
    Also the ?'s and square boxes don't add up to the characters in the message i.e.. a 50 character message will be sent as may be 10 ?'s or sometimes just a few. The annoying thing about it is, it looks fine before and as you send it, but when you look at the message you have sent it's as described and rather sinister looking for the recipient lol.
    One step Forward-Three steps Back!...dont even start going on about the flash player lmho...What I need is to be able to butcher the N8's camera into my old N95 then there would be no problems
    £400 odd quid for a 12 meg nokia camera, you can get an SLR for that money....But hey wait..."You can't browse the web with an SLR!!"...Oh it's OK, you can't browse it with Nokias Flagship either lmao
    *Shakes head in disbelief*
    Here's the thing - I'm not a hater - I'm not just looking to bash Nokia. Personally, I'm drawn to their handsets because for me, OVI / Nokia maps is a killer app for me.
    All the same, though, and it does really irritate - key things people have been complaining about, still not fixed. Basic functions that people have been wanting from various normal apps not implemented. Yet Anna looks a bit more funky.
    Same with the mapping betas - well actually worse - 3.06 for me seems to work very well - practically all the key things working quite well. Not perfect, and certainly could be enhanced.
    But the recent betas have been awful - ripped out functionality, removed configuration options, dumbed down functions - but again, it looks more funky. But it all just leaves me with a big "So what?". The newer versions simply don't work as well, are not as capable, and all with some dogmatic opinions expressed as the rationale behind why some things have been removed, some options removed, and some bugs not addressed.
    If they'd just focus on getting the stuff that doesn't work well, to work, in the process not remove good features or configuration options that many will want to use, THEN - if they have the time - update the visuals, then fine. But I'm sick and tired with the focus on form over function - it's making me question my entire reason for sticking with Nokia handsets - their mapping app - and I don't want to be told that mapping on phones is due a paradigm shift - I just want it to work well, with the maps updatable and relevant.

  • CO-Product, price difference issue

    Dear Experts,
    we are getting a probleum in CO-product, price difference do not split correctly.
    Suppose there are three product A is the main product and B, C are Co-product, maintain equal valance number in material master MRP-2 view, 
    Planned qty in BOM is A-40, B-30,C-30
    Actual GR QTY from PO.      A-50,B-20,C-30
    Price difference after settlement is 50,000/-, that fifty thousad should be distributed in actual quantity receive from from PO but system distributed on planned quantity, Material Ladger is active.
    Please help to solve the issue
    Thank you,

    Hi Tanmay
    Pls check if the settlement rule in production order is updated according to rules from material master.
    Remember that first you have to update the rules in material master and after create the PO, so it gets the rules from material master.
    I believe you can also change the rules for co-product in KOB5.
    Regards

  • Exchange of rate difference issues invoice verification!(Emergency!)

    Hi,experts:
        The SAP version is R3/30F,  I have some issues like this:     
        We do the good receipt to a purchase order with currency USD(the local currecny is RMB) in Aug,and reverse the good receipt in Sep,and then do the good receipt and the invoice entry in Oct,When entring the invoice in Oct,the system creat a exchange of rate difference with USD currecny ,the amount is just the reverse USD amount(the RMB account divides the exchange of rate)subtract the first good receipt USD amout,Why dose the exchange of rate difference happen?
    Detail example as below:
    the purchase order amount in USD: 500 and the currency of the purchase order is USD
    exchange of rate in Aug:6.5, exchange of rate in Sep:6.8,exchange of rate in Oct:6.75
    the first good receipt amount in RMB::3300=500*6.5
    the good receipt reverse amount in RMB:3300=500*6.5
    the second good receipt  amount in RMB:3400=500*6.8
    there is no USD amount displayed  in good receipt document,just RMB.
    the exchange of rate difference amount in invoice verificaion in USD(the currency of the invoice is USD):11.11= 3300/6.5-3300/6.75
    We think the exchange of rate difference should not be created here.Can anyone give some sulutions?Thans in advance.

    Everyone,Please,Help!

  • Timestamp difference

    hi all
    how to find the timestampdiff function
    can any one give me the syntax
    Thanks
    Sreedhar

    hi Sreedhar,
    Try in google before posting in forums
    My Google results for you
    You can use TimestampDiff to get the date difference.
    Here is the syntax:
    TimestampDiff(interval, timestamp1, timestamp2)
    Where:
    -- > interval = The specified interval.
    Valid values are:
    SQL_TSI_SECOND,
    SQL_TSI_MINUTE,
    SQL_TSI_HOUR,
    SQL_TSI_DAY,
    SQL_TSI_WEEK,
    SQL_TSI_MONTH,
    SQL_TSI_QUARTER,
    SQL_TSI_YEAR.
    thanks,
    Saichand.v

  • Calendar synch time difference issue

    When I synch between my Windows VIsta Calendar and my Blackberry Curve 9300, appointments synching from my Windows Calendar appear on my Blackberry two hours earlier yet both calendars are set to GMT,
    Can anyone help me to solve this issue?
    Many thanks
    Dan

    Hello corndoll and welcome to the BlackBerry® Support Community Forums.
    Have you checked the Time Zone setting in your Microsoft® Outlook® to ensure it's set to the same as your device and computer?
    When you create a new appointment in Outlook, is the Time Zone being used the correct one?
    In your Device, when you go to create a new appointment, is the proper TIme Zone being displayed when creating the appointment? 
    Thanks!
    -HMthePirate
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • Watch out for timestamp differences, will produce Bridge / xmp problems!

    Hi all,
    Setup: CS5, Win 7 32b, Canon EOS600D.
    I forgot to change the camera's internal date/time from
    summer time to winter time. Because of this, Bridge
    would not accept and show changes made in ACR
    (not until one hour had passed!).
    It turned out that what timestamp a photo will receive
    depends on if you download the photo using
    Bridge / Photo Downloader or EOS Utility:
    Computer time: 14:31.
    Camera time: 15.25.
    Time stamps from Bridge download:
    created 14:31, modified 15:25, taken 15.25
    Time stamps from EOS Utility download:
    created 15:25, modified 14:31, taken 15:25.
    Using the workflow Bridge -> Photo Downloader.
    Bridge -> ACR | make a crop | click Done
    -> Back to Bridge, the Bridge thumbnail would not
    show the cropped photo, just the original, uncropped one.
    Using the workflow EOS Utility  -> Fetch ->
    Bridge -> ACR | make a crop | click Done
    -> Back to Bridge, the Bridge thumbnail will show the
    cropped photo as intended.
    Since the Bridge workflow had a modified time that was
    one hour ahead, it would take one hour before
    any ACR changes would be reflected in any
    Bridge thumbnail.
    So: which time stamp is "correct"?
    The created/modified from EOS Utility
    or the modified/created from Bridge download?
    The one which makes me able to see ACR changes in
    Bridge thumbnails at once, of course -- i.e. in my opinion,
    EOS Utility behaves correctly.
    Or are there any differing opinions?

    In Bridge, "Date Created" is the date the Photograph was taken: i.e the date recorded by your camera and stored within the file. "Date File Created" is the date when you created the file on disc, that is the date/time when you downloaded the picture from your camera.
    So when the date the picture is modified is an hour before the time the picture was taken I can see the confusion in Bridge.  Just looking at it as numbers, it is not possible to change something that has not been created yet.  That is what Bridge is saying.

  • BW System with 2 factory calenders - Time Difference - Issue

    I have 2 source systems for our BI Implementation, which inturn maintains 2 factory calenders---> IN and KR.
    I am creating 2 reports based 2 source systems (using different factory calender).
    the reports need to calculate the time diff between 2 dates(D1, D2) and 2 times(T1 and T2) into hours based on factory calender. Report 1 based on IN calender and Report 2 based on KR Calender.
    But Both the reports are giving the same time difference, even though the No. of working days are different for each factory calender.
    For Eg : D1 - 2007.12.01; D1 - 2007.12.31; T1 - 00:00:00; T2 - 00:00:00
    I have used the FM :  SALP_SM_CALC_TIME_DIFFERENCE, to calculate the time diff.
    In report 1 the time diff = 30 days ( since 1 holiday in Dec month based on IN Calender)
    In report 2 the time diff should be 28 days ( since 3 holidays in Dec month based on KR Calender ), but its also giving 30 days as timediff.
    Plz provide the solution.
    Thanks
    Shekar.

    Any Info.
    Shekar

  • L440 System Update / Update retriever Differences/Issues

    I have Got some issues on the L440 model using Update Retiver / Thin Installer  model is . (20AS)
    Update retriever is not showing the following that system update shows
    Thinkpad power manager v6.64.2
    BIOS update
    Update retriever does show
    Intel WLAN Driver - 7[64] V16.10.0
    But thininstaller does not show this when run on the machine!!!
    It Also has problem installing
    Intel SATA Controller AHCI Driver - 7/8[64] - V12.8.1.1000
    Warning 2014-03-03 , 03:15:26
     at Tvsu.GenericPackageInstaller.InfInstaller.InstallUpdate()
     Message: An error ocurred trying to install Intel SATA Controller AHCI Driver - 7/8 [64] update
    Can anyone help with this ?

    Can you do another search through UR and see if the missing content is showing up now?  We had some issues with the power managment driver and also the Intel WiFi driver packages.  There is a new Intel WiFi package that targets properly to all the supported models.  You will see in UR one package that can be used for intial installation on all models and one package that should be used for upgrading a previous driver for non-7260 cards.  If you are doing deployments of new systems just get the first one.

  • Timestamp server issue - urgent

    hi,
    i'm publishing to Air from Flash CS4 Pro.
    We created a certificate to embed which was publshing our Air files successfully a few weeks ago.
    We have tried to publish the same files today for a client and Air produces the following error:
    "There was an error connecting to the timestamp server. You may no have a connection to the network, or the server itself may have a problem."
    We are connecting to the default timestamp server which i assume is:
    https://timestamp.geotrust.com/tsa
    but if navigated to this url directly i get a "404 missing" error
    can anyone help with why?
    is this server down or should we be using an alternative timestampe server - if so what and how do we go about this?
    regards, and thankyou in advance,
    Rich

    It appears to be working now. (It isn't a web server, so navigating a browser to that URL doesn't do anything useful.) If you are still having trouble, you should look at your internet connection. I don't know of an alternative server, but you can turn off time-stamping (not recommended for a publically-distributed build) with the -tsa none option.

Maybe you are looking for

  • Problem in JAXB for processing XML files

    hello I have been working on a project where i need to process data in XML format. the flow goes thus I have 28 data elements that i need to represent as a XML so i compile the schema files and generate the class files for each of the tags and thus i

  • Required Input fields in ADF form asterix alignment

    Hi All, I have a login form with two fields username and password which are both mandatory I want to display it like this Username * | | Password * | | when I choose required in the Property window it shows up like this * Username | | * Password | |

  • 10G Exoress on Ubuntu

    I have installed the DEB package of Oracle 10G express on my ubuntu 9.04+. It added a new sub menu - Oracle Database 10g Express edition - in Application menu. I added my current user and oracle user to the dba+ group. Now when I click on the item, G

  • Status bar in web browser

    I'm adding a status bar to a web browser and I've run into a little problem. I can't get the status bar to change to reflect the url the user has the mouse over. I need to know if there's an event listener that I can use to do this. Keep in mind that

  • Refer a book on Oracle Financials

    Hi All, I am new to Oracle Financials. Can anyone please suggest me some books on Oracle Financials. I am currently working on Oracle Forms and Reports and I want to go into Oracle Financials (Techno Functional). Appreciate your help. Thanks, Madhu K