Crystal Reports for Eclipse Designer Guide

Days360

Description
Days360 returns the number of days between two dates using a calendar that has 30 days in a month, and 360 days in a year, commonly used for financial accounting.
Overloads
  • Days360 (startDate, endDate)
  • Days360 (startDate, endDate, method)
  • Arguments
  • startDate is a Date or DateTime for the start of an interval of time.
  • endDate is a Date or DateTime for the end of an interval of time.
  • method is an optional Boolean value specifying the type of basis to use. FALSE is the default and implies the American 30/360 day basis while TRUE implies the European 30/360 day basis.
  • Returns
    Number value
    Action
    Days360 returns the number of days between two dates using a calendar that has 30 days in a month, and 360 days in a year, commonly used for financial accounting. If the end date is earlier than the start date, then a negative answer is returned.
    The formula is (Y2-Y1) x 360 + (M2-M1) x 30 + (D2-D1) where:
  • Y1, M1, and D1 are the year, month and day of the start date, and
  • Y2, M2, and D2 are the year, month and day of the end date.
  • For the American 30/360 basis, if D1 is 31 then it is changed to 30 and if D2 is 31, it is changed to 30 only if D1 is 30 or 31. For the special case of February, '31' in the above formula is replaced by 'the number of days in the month'.
    For the European 30/360 basis, D1 is changed to 30 if D1 is 31, and similarly D2 is changed to 30 if D2 is 31.
    Examples
    Days360(DateValue(2000,1,1),DateValue(2000,2,1),FALSE)
    Returns 30 since each month is assumed to have 30 days. The same value is returned if the European system is used.
    Days360(DateValue(2000,2,28),DateValue(2000,3,31),FALSE)
    Days360(DateValue(2000,2,28),DateValue(2000,3,31),TRUE)
    Days360(DateValue(2000,2,29),DateValue(2000,3,31),FALSE)
    Days360(DateValue(2000,2,29),DateValue(2000,3,31),TRUE)
    
    The first line returns 33, the second returns 32, the third returns 30, and the fourth returns 31. Note that February 2000 contains 29 days.
    Comments
  • This function is similar to the Excel function of the same name.
  • To calculate the difference between two dates using the normal (actual/actual) calendar, subtract the earlier date from the later date.
    DateValue(2000,3,31) - DateValue(2000,2,29)
    Returns 31.



  • SAP BusinessObjects
    http://www.sap.com/sapbusinessobjects/
    Support services
    http://service.sap.com/bosap-support/
    Product Documentation on the Web
    http://help.sap.com/