Focal Point
[CLOSED] Trying to count the matters based on date range-Help needed ASAP

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/247101694

July 27, 2010, 01:55 AM
Shru
[CLOSED] Trying to count the matters based on date range-Help needed ASAP
I am trying to count the number of matter beased on the date ranges.
I have to dates open date and the resolved date.
I am looking at those matters which are active i.e where resolved date is Null. This is one senario.

But i am facing problem when the open date and resolved date does not fall on the same month

Eg - if the open date of a particular matter is 02 Feb 2010 and the matter resolved date is 02 May 2010, so i need to get the count for that matter to be one for the month of Feb, Mar, and Apr.

can anyone please help me wiht this

This message has been edited. Last edited by: Kerry,


769 Excel,PDF and HTML
July 27, 2010, 05:29 AM
Dan Satchell
If your dates are SmartDates, you can use function DATEDIF to calculate the number of months between two dates. If the resolved date is NULL you could use the current date as the resolved-date for determining how many months the issue has been open.

NUMBER_OF_MONTHS/I5 = DATEDIF(open-date,resolved-date,'M');


EDIT: The above will give you whole months. If you prefer to include fractions of a month, then use DATEDIF to calculate the difference in days and divide by 30 to get a close approximation of months with fractions thereof.

NUMBER_OF_DAYS/I5 = DATEDIF(open-date,resolved-date,'D');
NUMBER_OF_MONTHS/F5.1 = NUMBER_OF_DAYS / 30 ;

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
July 27, 2010, 09:51 AM
Francis Mariani
I would suggest not putting "ASAP" in the forum post subject, specially since most of the people helping you are in a time zone where we're still sleeping.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
July 27, 2010, 09:58 AM
njsden
Good point.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.