Date Calculate difference between 2 days using DateField

Hi,
I have 2 dateFields on stage. I hav2 a text box ,which I want
to display, the number of days difference, when I select datefield1
and then datefield2. The code I have is not working, can you please
point me in the right direction ?
I have done this successfully, with out the Datefield, but I
want to include the Datefield.
Thanks,
Paul

Yes, this helped - thank you very much. I converted the code to work with my table/column names and it worked, but only on the SQL/Object side, not on the app/item/form side. Again, I don't have a column in the table for this item, as I wanted to only do the calc on the app side. I just don't know how to pull this on the app side to make it display ok. I would like to see HH:MI as the item display.
I keep getting:
"ORA-06550: line 1, column 27: PLS-00103: Encountered the symbol "SELECT" when expecting one of the following: ( - + case mod new not null continue avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date pipe
ERR-1020 Error in PLSQL item processing (function)."
My code that fires ok in SQL Command is:
SELECT
TO_CHAR(sign_out, 'HH24:MI') sign_out,
TO_CHAR(signintime, 'HH24:MI') signintime,
(sign_out - signintime) * 24
FROM appointment
where appointment_id = 1
I even tried the following to make it simple, which fires ok as well:
SELECT sign_out-signintime from appointment where appointment_ID=1
Both of which provides a data response of:
SIGN_OUT-SIGNINTIME
+000000000 01:00:00.000000
....which is correct for record 1 (I'll remove the where ID=1 afterward so it's dynamic to the record being displayed of course)
Now to get this to function correctly on the app/item side? I can add the item, but don't know exactly how to define it, or any other necessary steps? Your help is greatly appreciated.
Thanks
Brad

Similar Messages

  • How to calculate difference between date in hours?

    Hi All.
    I need calculate difference between first and last date. I'm using the code below:
    int differenceDate = CalendarRule.elapsedDays(fromDate : myFirstDate, toDate : myLastDate);
    This code return an result in days. But I need that result was in hours.
    Has anybody help me?

    Interval dif;
    dif = myLastDate - myfirstDate;
    display((dif.hours));
    Hope it helps

  • Calculate difference between two dates/times

    Hi all,
    Is there any function module to calculate difference between two dates/times which are in TIMESTAMPL format.
    I need to know how many millisconde(second,minutes, hours... )there is between these two times.
    Please, It is urgent
    Thank you all.
    Karim

    hi,
    try the following function
    CALL FUNCTION 'CCU_TIMESTAMP_DIFFERENCE'        
          EXPORTING                                  
               timestamp1 = timestamp1               
               timestamp2 = timestamp2               
          IMPORTING                                  
               difference = diff                     
          EXCEPTIONS                                 
               OTHERS     = 1. 
    the above function gives the difference in seconds...
    try the following  code to set the resolution to milliseconds..
    SET RUN TIME CLOCK RESOLUTION LOW
    check the thread for details:
    SET RUN TIME CLOCK RESOLUTION?
    all the best!!!
    Regards,
    Aparna

  • Need Help to calculate difference between times

    Hello everyone,
    I have two fields which just stores the time in 24 hour format ex: 08:00 and 20:00 now I want to calculate difference between the two times
    Kindle help me
    Thanks for your help
    Thanks
    Ravi

    Are your fields of varchar2 datatype or...?
    Is 08:00 the start time or 20:00?
    Date arithmetic is pretty simple in Oracle if you use the right datatype.
    See:
    http://asktom.oracle.com/pls/asktom/ASKTOM.download_file?p_file=6551242712657900129
    Assuming you are storing strings:
    SQL> -- generating sample data:
    SQL> with t as (
      2  select '08:00' btime, '20:00' etime from dual
      3  )
      4  --
      5  -- actual query:
      6  --
      7  select numtodsinterval(to_date(etime, 'hh24:mi') - to_date(btime, 'hh24:mi'), 'day') nti
      8  ,      (to_date(etime, 'hh24:mi') - to_date(btime, 'hh24:mi'))*24 dt
      9  from   t;
    NTI                                                                                 DT
    +000000000 12:00:00.000000000                                                       12
    1 row selected.
    SQL>

  • Difference Between Current Day and fist day of the payroll period

    Hi,
    How do i find the difference between the current day and the first day of the payroll period with period parameter XX.
    Operation VARSTFDYXX is used to decide if the current day is the first day of the payroll period. But is there any operation available to check the difference in exact number of days.
    I know hrs=y is used to find difference between current day and a date specification record from IT0041, but i need to check difference between current day and first day from a payroll period parameter.
    Any response is greatly appreciated.
    Thanks,
    Imaneul Rajiv

    No! haven't seen it at all! Do I have to drain the battery completely and then charge it? I did that the first day I bought the phone and yet the stats are the same for me
    PS: I am referring to the Call Time stats and not the Usage/Standby stats

  • Date Difference in Months & Days using XSLT

    Hi,
    I have two dates and want to calculate how many months & days in between those using XSLT, do we have inbuilt functions to do the same?
    E.g. Start Date: 05/25/2014
           End Date: 12/31/2014
    Desired Output: 7 Months & 7 days (end date included in calculation)
    Thanks in advance.

    Hi,
    In XLST 2.0 (XPath 2.0) you can just use operator - to find difference between to dates, there's an example on link below...
    http://stackoverflow.com/questions/5544762/finding-the-difference-between-2-dates-in-xslt
    However, Oracle's implementation is not a full XSLT 2.0 (XPath 2.0), so it may not work... Please test it and let us know...
    <xsl:stylesheet version="2.0"
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
       xmlns:xs="http://www.w3.org/2001/XMLSchema"
       xmlns:my="my:my">
       <xsl:output omit-xml-declaration="yes" indent="yes"/>
    <xsl:template match="/">
       <xsl:variable name="vDate1"
       select="my:dateFromUsDate(/*/d1)"/>
       <xsl:variable name="vDate2"
       select="my:dateFromUsDate(/*/d2)"/>
       <xsl:sequence select=
       "($vDate1 - $vDate2) div xs:dayTimeDuration('P1D')"/>
    </xsl:template>
    <xsl:function name="my:dateFromUsDate" as="xs:date">
      <xsl:param name="pUsDate" as="xs:string"/>
      <xsl:sequence select=
      "xs:date(concat(substring($pUsDate,7,4),
      substring($pUsDate,1,2),
      substring($pUsDate,4,2)
      "/>
    </xsl:function>
    </xsl:stylesheet>
    Cheers,
    Vlad

  • Pivot table - calculate difference between 2 data points

    I have a pivot table that shows Q1 2008 revenue, and Q1 2009 revenue, by account.
    How do I create a summary column on the right that shows the difference between these 2 values? 2009 value minus 2008 value.
    example:
    2008 2009
    Account Q1 Q1 Revenue Growth
    Joe's Garage $1000 $2500 $1500
    Thanks

    You can try one thing. In the pivot table design, if you have any field in columns then create a formula,name it growth and write $3 - $2.
    This will represent the subtraction of 2nd column from 3rd.
    IF you don't have any field in columns, then duplicate any of the existing ones,pull it in columns and build the same formula.
    Let us know if this works.

  • Function Module for Date/ Time difference in Working Days

    Hi all,
    Are there any function modules which will calculate the difference between a date AND time, but in working days?
    I can use the FIMA_DAYS_BETWEEN_TWO_DATES_2 FM for the dates, but I need to include times in this as well.
    This is for situations where the 'starting date' is a non-working day, and the 'end date' is a working day.  In this situation I need to take all the hours and minutes into account, which happened on the working day.  To give an example -
    Start date:  04.07.2010 (Sunday - Non working day)
    Start time:  21:12:36
    End date:  05.07.2010 (Monday - Working day)
    End time:  04:47:24
    I realise there is a Time option in this function module, but when I test it, it doesn't seem to be returning the desired results (returns 0 for days and time).  I am using '5' as the I_STGMETH and 'GB' as the I_SKALID. 
    I need a calcuation which will return the time, post midnight on the working day - in this example, 4 hours, 47 minutes (seconds are optional!).
    Can anyone help? - can I still use FIMA_DAYS_BETWEEN_TWO_DATES_2 but with different parameters?
    Thanks
    Mischa
    Edited by: Mischa Gulseven on Jul 20, 2010 10:40 AM

    Hi,
    Thanks but this FM does not seem to account for working days.
    For example, if I use:
    DATE1                           04.07.2010  (non working day)
    TIME1                           04:00:00
    DATE2                           05.07.2010   (working day)
    TIME2                           21:00:00
    It will give the following results -
    DATEDIFF                                                      1
    TIMEDIFF                                                     17
    EARLIEST                        1
    I don't want to account for the non-working day so the result I actually want would be to calculate from midnight on 05.07 to 21:00 on 05.07 which should be 21 hours.
    I suspect I probably need to include the STGMETH and the factory calendar somewhere in the FM?
    Does such a FM exist, or could anyone help me with some ABAP for this?
    thanks
    Mischa

  • Calculate difference between every other time record

    Here's what I have going on.  Users are keeping track of time they work on a project.  Data to be used in contained in two columns.  In the first column they enter "start" or "stop".  In the second column they input the date and time.  So, output would look something like this:
    start     1/1/2011 3:30pm
    stop     1/1/2011 3:35pm
    start     1/2/2011 1:00pm
    stop     1/2/2011 1:30pm
    start     1/2/2011 2:00pm
    stop     1/2/2011 2:18pm
    I need to be able to calculate the difference between the start and stop time and then create a running total of those time.  Running total not an issue but what can I do to calculate the time difference between start and stop?  Been awhile since I used Crystal (about 5 years) so I've forgotten way too much.  Another issue that I'm running into is that sometimes the users forget to enter the start or stop, so I might have two stops in a row (with one missing the start time) or two starts in a row.  I'm not completely sure how I want to handle those yet.  I may just throw those records out but not certain how I'll do that yet.
    Sorry if this is a bit basic.  Trying to relearn Crystal again - oh, and it's crystal reports 10.

    Here are a couple of formulas that should help you out.
    This will calc the time diff between sequential start and end times
    WhilePrintingRecords;
    Global DateTimeVar x := IF {TableName.Type} = "start" THEN {TableName.TimeStamp} ELSE x;
    Local DateTimeVar y := {TableName.TimeStamp};
    Local NumberVar z:= IF {TableName.Type} = "start" THEN 0 ELSE DateDiff("n", x, y);
    And this one will provide a manual running total
    WhilePrintingRecords;
    Global DateTimeVar x := IF {TableName.Type} = "start" THEN {TableName.TimeStamp} ELSE x;
    Local DateTimeVar y := {TableName.TimeStamp};
    Global NumberVar z:= z + IF {TableName.Type} = "start" THEN 0 ELSE DateDiff("n", x, y);
    Note that you'll want to sort  the records by the "TimeStamp"
    HTH,
    Jason

  • Find the same day in a range then find the difference between the days

    Need assistnace with the following .
    I have a table of ids for courses and each course class is on a day. I have to take the first day the course class is on and find the next same day then work out the difference in days.
    eg. a course class is on a saturday then have to go thru the course class associated to a course and find the next saturday then work out the difference.
    Anyone able to help - it would be much appreciated

    course class id date day
    abcdefa 18/12/2002 wednesday
    abcdefb 19/12/2002 thursday
    abcdefc 20/12/2002 friday
    zxvyza 17/12/2002 monday
    zxvyzb 20/12/2002 thursday
    zxvyzc 21/12/2002 friday
    zxvyzd 24/12/2002 monday
    zxvyze 26/12/2002 wednesday
    lmnopa 11/11/2002 tuesday
    lmnopb 12/11/2002 wednesday
    lmnopc 14/11/2002 friday
    lmnopd 19/11/2002 wednesday
    lmnope 21/11/2002 friday
    where abcdefa, abcdefbc, abcdefc are for course id abcdef
    and the other set of course class ids are for course id zxvyz.
    and 3rd set relates to course id lmnop.
    expectation:
    the difference between days for the first set of data to be 0
    the difference between days for 2nd set to be 7 days (ie. take the first day for the course class and see if can find another that is the same and then work out the difference i.e monday) then return the difference then go to next course class id.
    the diff between 3rd set is calc the diff between Wednesdays, ignore the last friday and find the next course class id. the answer here will be 7 days.
    I have worked out the days from the dates (although the above is only an example)but wasnt sure how to pick the same days then work out the difference and then move to the next course class id. Some course classes wont have another same day.

  • Looking for a formula to calculate difference between two values

    So, heres my problem...
    I have a set of incremental values which act as thresholds, 100, 200, 300, so on. Another number is independent and correlates to that set of values, say 148.
    I want another cell which calculates the difference between 148 and 200, but then recognises that when 148 goes over 200 that the next threshold has been met, so then resets and starts calculating the difference between that new number and the next threshold,
    300.
    Is it possible to do this all in the same cell?
    Thanks in advance.

    Re: variable number difference
    With the independent number in cell F8, maybe...
      =IF(MOD(F8,100)=0,0,100-MOD(F8,100))
    Jim Cone
    free & commercial excel programs (n/a xl2013)
    https://jumpshare.com/b/O5FC6LaBQ6U3UPXjOmX2

  • Correlation in bpm - Difference between activating and using correlation

    Hi
       I would like to know the difference between between activating a correaltion and using a correlation in a step.

    Correlation is used when you have multiple recieve steps in the BPM to differentiate each file.
    Consider your recive step is executed and the BPM is active waiting for the other file to comne in.
    Before the next file comes in , if another BPM is activated becuase your recived recive1 message. Now, when the next message comes in , how does XI know which BPM instance is to be used.
    Correlation is used in these cases. to corelate the messages.,
    some people name their Correlation as correlation in IP. So it means using the correlation 'correlation'.
    its like me creating a message interface by the name 'messageinterface' so finally i am using the message interface messageinterface !!!
    Check this weblog ..
    /people/sravya.talanki2/blog/2005/08/24/do-you-like-to-understand-147correlation148-in-xi
    to understand it refer -
    /people/sravya.talanki2/blog/2005/08/24/do-you-like-to-understand-147correlation148-in-xi
    Also Ref checklist on when it is needed -
    http://help.sap.com/saphelp_nw04/helpdata/en/6d/94364296f1b26be10000000a155106/content.htm
    Thanks !!

  • How to find the phase difference between two signals using Hilbert transform

    hi, 
        I am new to LabView.... I am trying to find phase difference between two signals. I sucessfuly found out the phase difference between two predefined waves using single tone measurement. .... But I really want to know how can I measure phase difference between two signals( not predefined... ie we don't know the initial conditions) using hilbert transform or any transformation techniques (without using zero cross detection).. I tried by using hilbert transform based on algorithm... bt I am getting error.... plz help me
    Attachments:
    phase_differece.vi ‏66 KB

    you could try something similar to this, for each table pair that you want to compare:
    SELECT 'TABLE_A has these columns that are not in TABLE_B', DIFF.*
      FROM (
            SELECT  COLUMN_NAME, DATA_TYPE, DATA_LENGTH
              FROM all_tab_columns
             WHERE table_name = 'TABLE_A'
             MINUS
            SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
              FROM all_tab_columns
             WHERE table_name = 'TABLE_B'
          ) DIFF
    UNION
    SELECT 'TABLE_B has these columns that are not in TABLE_A', DIFF.*
      FROM (
            SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
              FROM all_tab_columns
             WHERE table_name = 'TABLE_B'
             MINUS
            SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
              FROM all_tab_columns
             WHERE table_name = 'TABLE_A'
          ) DIFF;that's assuming, column_name, data_type and data_length are all you want to compare on.

  • What is the difference between Outlook features using exchage server and using 3rd party mail server ?

    Hi~ I'd like to know what the difference is between Outlook features using exchage server and using 3rd party mail server.
    If I use 3rd party mail server with Outlook, Outlook features are the same as Exchange Server ?
    I want to use all Outlook features..

    The basic features (and many advanced features) are identical in all accounts. With pop3, your mail, calendar, contacts, tasks, notes are stored in a pst and are only on the computer. IMAP accounts only sync email back to the server, not calendar,
    contacts, and tasks. Outlook.com EAS accounts (aka Hotmail) syncs calendar and contacts back to the server. Exchange mailboxes stores everything on the server - mail, calendar, contacts, custom views, rules - and if you open the mailbox in outlook on
    any other computer, the mailbox is identical. Because everything is on the server, you'll have much better syncing with smartphones and tablets with Exchange mailboxes.
    Calendar sharing, open other users folder, and retention policies are Exchange-only. Mail Tips and apps (linked under the reading pane header in Outlook 2013) are Exchange-only.
    Diane Poremsky [MVP - Outlook]
    Outlook & Exchange Solutions Center
    Outlook Tips
    Subscribe to Exchange Messaging Outlook weekly newsletter

  • Differences between OIM Connectors using Adapter Factory and Generic Tech

    Hi,
    Can any one please tell me what is the difference between Oracle Identity Manager Connectors by using Adapter Factory and Generic Technology.
    Regards,
    Raghunath..

    This issue is a bit complex but let me try to explain.
    One way to look at it is to consider cars with automatic and manual gearboxes. A car with a manual gearbox requires more skills of the end user. You do need to understand how to use the clutch and what gear to use under what circumstances. In a car with an autoamtic gearbox all of these things are abstracted away from the user. On the other hand a automatic gearbox is more complex to manufacture, especially if you would do it yourself with just some machine tools and some basic materials available.
    In the same way an adapter factory connector requires a bit more skill to install and configure. A generic tech one is a lot more point and click. The downside is that creating the generic tech takes a little bit more effort and skill.
    Excellent article by Nishant on this : http://blog.talkingidentity.com/2007/06/understanding_oims_generic_tec.html
    Hope this helps
    /Martin

Maybe you are looking for

  • Error on deploying Portlet Producer Application

    Hi All, I am trying to create a very simple Portlet Producer Application in JDev 11.1.1.4 but I am unable to deploy it with my integrated weblogic server. The error says. 49192]Operation 'deploy' on application 'HellowWorldPortlet' is in progress on

  • Wrong planned cost calculation while actual is calculating correct for internal activities

    Dear all, I am facing an issue in which when i am doing network costing with work center, activity type, cost center and giving per hour rate in KP26. System is calculating correct actual cost but every time its calculating wrong planned cost. For ex

  • Po -sto

    Hi while creating po for sto getting error message mat not subjected to inventory management - no data exists for plant in plant/slocation stock view But i've maintained slocation view in mat master pl suggest

  • Pro Applications Update didn't update

    I had a problem with an error message saying the "file is too new for this version of the software. I have FCP 6 (part of Final Cut Studio 2) I read here that the fix to the problem is an update which I just downloaded and installed, but my FCP 6 was

  • Even editing text in Design View is now difficult in DW CC?

    Hi All, Even editing text in Design View is now difficult in DW CC? I just upgraded. It seems difficult - or impossible - to select, copy and paste multiple blocks of text from one place to another - unless you work in the Code View. Text blocks are