Formula to calculate the date difference

Hi Experts,
I am having a requirement . where i need to create the query with difference between the two dates. like date1 and date2
Now i have created a formula for this diff =date1 - date 2 now the client want that this operation has to b executed when date2 hold some value r else "diff" column has to  b blank.
Regards

KK,
if (date_diff > 0) * date_diff.
it will first check wheather data_diff >0 . Suppose its value is 5.
now after that v r multiplying with date_diff ie 5 then the result will be 25 right ??
--> No, if (date_diff > 0) is boolean operation return "0" or "1" only. if its true then 1 or 0.
So: same example: if (date_diff > 0) * date_diff --> 1*5 = 5.
Hope it Helps
Srini

Similar Messages

  • How we calculate the date difference between two list in SharePoint 2010

    Hi friend's....I have two list first is list1. In this list i have two coulmn start_date and End_date. In second list2 i have two column HolidayName and Holiday_date. Now i want two find the number of day in list1 Excluding Weekend and Holiday_date(that
    column from list2). How i will do ..? Please help me dosto..

    Thanks for reply...
    I have done the date difference in list1. But i want to Exclude the Holiday_date form list2.
    I have list1 - Start_date , End_date, Number_of_day(Exclude weekend and Holiday_date between Start_date and End_date )
    list2 - HolidayName, Holiday_date
    Now how i will calculate the Number_of_day in first list.

  • Calculate the date difference on essbase 9.3

    Hi Everbody,
    I want to calculate the difference between 2 date in essbase 9.3. Is any one did this practice ?
    I have done this but that is not a better way. so please share your thought with me.
    Regards
    Vikram Singh

    Hi,
    DateDiff function returns the difference (number) between two input dates in terms of the specified date-parts, following a standard Gregorian calendar.
    Syntax
    DateDiff ( date1, date2, date_part )
    date1+ is the number representing the input date between January 1, 1970 and Dec 31, 2037. The number is the number of seconds elapsed since midnight, January 1, 1970. To retrieve this number, use any of the following functions: Today(), TodateEx(), GetFirstDate(), GetLastDate(), DateRoll().
    Date-time attribute properties of a member can also be used to retrieve this number. For example,
    Product.currentmember.[Intro Date] returns the product introduction date for the current product in context.
    [Cola].[Intro Date] returns the product introduction date for Cola.
    date2+ A second input date. See date1.
    date_part+ Defined time components as per the standard calendar.
    DP_YEAR - Year of the input date.
    DP_QUARTER - Quarter of the input date.
    DP_MONTH - Month of the input date.
    DP_WEEK - Week of the input date.
    DP_DAY - Day of the input date.
    Edited by: Cnee on Jul 13, 2009 3:19 AM
    Edited by: Cnee on Jul 13, 2009 3:20 AM

  • How to calculate the hour difference between two dates?

    hi all,
    how to calculate the hour difference between two dates?
    eg i trying this...
    ((TO_DATE(TO_CHAR(GRNi.reference_date_4,'hh24:mi'),'hh24:mi') -
    TO_DATE(TO_CHAR(NVL(GRNi.reference_date_3,SYSDATE),'hh24:mi'),'hh24:mi'))*24)*60 Act_Hr
    Reg.
    AAK

    Hi
    To break the diff between 2 dates into days, hours, minutes, sec -- you can use the following:
    select to_char( created, 'dd-mon-yyyy hh24:mi:ss' ),
    trunc( sysdate-created ) "Dy",
    trunc( mod( (sysdate-created)*24, 24 ) ) "Hr",
    trunc( mod( (sysdate-created)*24*60, 60 ) ) "Mi",
    trunc( mod( (sysdate-created)*24*60*60, 60 ) ) "Sec",
    to_char( sysdate, 'dd-mon-yyyy hh24:mi:ss' ),
    sysdate-created "Tdy",
    (sysdate-created)*24 "Thr",
    (sysdate-created)*24*60 "Tmi",
    (sysdate-created)*24*60*60 "Tsec"
    from all_users
    where rownum < 50
    HTH
    RangaReddy

  • Xcelsius doesn't display the date difference in Preview

    Hi,
    Im using the Xcelsius Enterprise 2008 and I use XML connectivity for the source. I would like to do some date difference calculation on my spread sheet. But the result of the date difference does no appear on the Preview for some reason. My XML file has got the date format dd/mm/yyyy hh:mm. I tried to convert the date to number format by multiplying the date by 1. When I do this the result appears correctly as I want on the Preview, but the problem is when there is a first refresh, the date difference shows a error value "#Value". I tried to enable XML Map Properties -> When refreshing or importing data:
    1. Overwrite existing data with new data
    2. Append new data to existing XML lists.
    But still not of any use. Could any one please give me a tip to resolve my problem.
    Many thanks in advance.
    Priya

    Hi Priya
    Can you please tell me what formula are you using to take difference in dates?
    Just to tell you as a point of information, Xcelsius is capable to handle very limited set of formulas. In spreadsheet you will see the formula working perfectly fine but right after hitting preview button you wont be able to see values calculated by certain formulas in Excel. So, its always good to use less and very basic formulas.
    Regards,
    Waqas

  • How to calculate the time difference in answers

    Hi,
    I need to calculate the time difference in BI answers and I dont have the access to the repository. I have the data in the following format
    10/12/2005 7:24:19 PM 10/12/2005 7:32:04 PM
    10/12/2005 7:50:47 PM 10/12/2005 8:52:36 PM
    10/12/2005 7:54:23 PM 11/4/2005 10:47:32 PM
    10/12/2005 9:05:51 PM 10/12/2005 9:08:58 PM
    10/12/2005 9:07:42 PM 10/12/2005 9:14:47 PM
    10/12/2005 9:09:02 PM 10/12/2005 9:10:57 PM
    I need to get the elapased hours between these two columns. Please help me
    Thanks

    you can use beans or create a case when statement like:
    case
    when TimeStampDiff(SQL_TSI_Min, table.column1, table.column2 ) <= 60 then 1 else
    when TimeStampDiff(SQL_TSI_Min, table.column1, table.column2 ) > 60 and TimeStampDiff(SQL_TSI_Min, table.column1, table.column2 ) <= 90 then 1.5 else
    when TimeStampDiff(SQL_TSI_Min, table.column1, table.column2 ) > 90 and TimeStampDiff(SQL_TSI_Min, table.column1, table.column2 ) <= 150 then 2.5 else
    end

  • In AP invoice i need to make "Terms date " field to calculate the date automatically when i select the payment terms

    In AP invoice i need to make "Terms date " field to calculate the date automatically when i select the payment terms.
    How can i do this?

    Hi,
    You can select the Payment Term at PO Header Level.
    When you book an invoice, that Payment Term will automatically defaulted to Invoice.
    You can define Payment Term in AP.
    Payment terms have one or more payment terms lines, each of which creates one scheduled payment. Each payment terms line and each corresponding scheduled  payment has a due date or a discount date based on either a specific day of a month, such as the 15th of the month, or a number of days added to your terms date, such as 14 days after the terms date.
    Payment Terms (Oracle Payables Help)

  • How to get Basic salary amount in the Housing formula to calculate the housing value as I used the DBI (NICDP_EMPLOYEE_BASIC_SALARY_AMOUNT_ASG_ENTRY_VALUE) but when run the Quick pay for the housing element alone result come 0, How to get Basic salary amo

    How to get Basic salary amount in the Housing formula to calculate the housing value as I used the DBI (NICDP_EMPLOYEE_BASIC_SALARY_AMOUNT_ASG_ENTRY_VALUE) but when run the Quick pay for the housing element alone result come 0, How to get Basic salary amount in the Housing formula to calculate the housing value as I used the DBI (NICDP_EMPLOYEE_BASIC_SALARY_AMOUNT_ASG_ENTRY_VALUE) but when run the Quick pay for the housing element alone result come 0

    Hi,
    Is your formula attached to basic salary element or some other element? You need to make sure that basic salary element has some value and is processed before this formula is called. Are you able to see value for basic salary element after payroll run?
    Regards,
    Pawan

  • Using Numbers, can I calculate the date that will be eg 45 days ahead of a given date?

    Using Numbers, can I calculate the date that will be eg 45 days ahead of a given date?

    MWB,
    Certainly. Let's say that your given date is in B2. The date 45 days earlier can be found with:
    =B2 – 45.
    Almost seems too simple.
    Jerry

  • "D2008178" - FM to calculate the date of the x day in a year

    Hi all!
    I am looking for a FM to calculate the date of a certain day in the year.
    For example which date has the day 178 of the year.
    This has nothing to do with the factory calendar!!!
    Thanks a lot for your help
    CU
    Peter

    Hi Peter,
    Please check this funtion module "FIMA_DATE_CREATE".
    Sample code as follows:
    REPORT  ztest_vinay.
    DATA: w_date TYPE vtbbewe-dvalut.
    PARAMETERS: p_date TYPE vtbbewe-dvalut.
    CALL FUNCTION 'FIMA_DATE_CREATE'
      EXPORTING
        i_date                        = p_date  " Here you need to pass first day of the year
        i_calendar_days         = 178
    IMPORTING
        e_date                        = w_date.
    WRITE: w_date.
    Regards,
    Vinay
    Edited by: Vinay Kumar Amruth on Feb 18, 2009 2:52 PM
    Edited by: Vinay Kumar Amruth on Feb 18, 2009 3:01 PM

  • How to calculate the phase difference between two square wave (acquired from two channel in one DAQ)

    Hello everyone ,
     I need a quickly help that as below :
    I am trying use PCI-6220 to acquired six signals from one rotation encoder (channel A, channel B,channel Z ,and their non-signals) .The encoder out signals will be square wave and 4000pulses per revolution. I set it rotation at 300rpm speed. I need show every square wave of six out channels in waveform and measure the A-B phase difference to check if the value is correct (designed value should be 90deg) .
    I have no idea how to measure or calculate the phase difference of two square wave base on synchronizate to acquire these two square wave from two channel on the PCI-6620....
    Anyone can give a idea how to calculate the phase difference with two square wave ?
    Thank a lot and Thanks again...
    Tim

    Tim,
    Here is a simple rising edge detector for one channel.
    Lynn
    Attachments:
    Rising edge.vi ‏15 KB

  • Formula to return the date of the fourth Thursday in a given month/year

    Using Excel 2013, I need a formula that returns the date of the fourth Thursday in a given month.  For example, if the date in
    A1 = 11/2/2012
    B1 needs a formula that references A1 and returns 11/22/2012
    or if
    A1 = 11/1/2014
    B1 needs a formula that references A1 and returns 11/27/2014.

    You can use this formula:
    =DATE(YEAR(A1),MONTH(A1),CHOOSE(WEEKDAY(DATE(YEAR(A1),MONTH(A1),1)),26,25,24,23,22,28,27))
    This formula has been derived from
    http://chandoo.org/wp/2009/11/25/findout-thanksgiving-date/
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • How to calculate the Time difference between 2 dates

    HI All,
    I am using HR_hk_diff_btw_2_dates to calculate the employee service dates.
    For that i  am inputing his hire date and Term dates and Output format as '05' i am getting output perfectly....
    But problem is  whe i am inputting the employee hire date is Dec 1 2007 and Term date is
    March 31 2009 It is coming as 1 year 3 months  31 days instead of 1 year 4 months directly .......How could we make it make last date also working day and get the O/p as 1 year 4 months ?Please Advice..
    Regard
    sas

    1. FM for difference betwwen two times:SCOV_TIME_DIFF
    Import parameters               Value
    IM_DATE1                        2008-01-01
    IM_DATE2                        2008-01-01
    IM_TIME1                        10:00:00
    IM_TIME2                        11:30:00
    Export parameters               Value
    EX_DAYS                         0
    EX_TIME                         01:30:00
    2. SD_CALC_DURATION_FROM_DATETIME : Finds the difference between two date/time and report the difference in hours
    L_MC_TIME_DIFFERENCE : Finds the time difference between two date/time

  • How to calculate the month difference between two date char. in Query?

    Customers would like to see how many months passed between two date type of characteristics (e.g., the month difference between the current date and the scheduled delivery date in the record) and put the result into the column as KF. 
    We would have to grab the fiscal year/period kind of value and then do the subtraction, e.g., if the current date value is 2/28/2008 and the scheduled delivery date value in the record is 12/01/2007, the correct result should be 2 month difference between these two date values, but could someone here give us the technical light on how to make this happen in query design?
    Thanks and we will give you reward points for the correct anwsers!

    Hi Kevin,
    The Badi is RSR_OLAP_BADI.
    You can create an implementation using Transaction  SE18.
    The implementation is per cube and is defined in the filters.
    In the Implementation you have the following methods :
    1. Define : Here you will provide the Keyfigure you need as a virtual one.
    2. Initilialize : Any Init Function you want to do.
    3. Compute. This is called per datarecord and here you can cimpute your value.
    Hope this helps.
    Pralay Ahluwalia

Maybe you are looking for

  • Change document file name via workflow - SharePoint Online

    Is it possible to change the filename of document uploaded in sharepoint online/onpremises using workflow? We would like to have documents uploaded to sharepoint but unfortunately some have the same name and this from a folder structure :( When i use

  • ITunes installation

    every time i open itunes (by clicking on the desktop shortcut) it says "Windows Installer: Preparing to install" then " please wait while windows configures iTunes" then it opens after that but i cant sync to my ipod because the system that comunicat

  • Two Assignments in InCopy's Assign Panel

    Now I'll install the workflow with InDesign CS5 and InCopyCS5 at medium  Newspaper. The problem is: I want that InCopy users (editors) to be  able put a INCX file to other assingment in InCopy's panel assignments Is it Possible? Have two assignments

  • Bootcamp disappears after updating to mavericks

    Hello all, i'm experiencing a lot of problems after updating to OS X Mavericks 10.9.4 especially with bootcamp. My bootcamp partition is greyed out in disk utility, access bootcamp,  i cant seem to mount it, delete the partition via bootcamp assistan

  • Third Party Chatting Software

    Does anyone know if third party chatting software like jivetalk count towards the number of texts u have or solely as data b/c my plan only has 200 texts. If it counts only as data that would be great!