Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Start and End Date Difference Less than One Year
Migrateduser
<p>Hello,</p>
<p> </p>
<p>I have a report that I am working on for a customer for Lease Management. They have a request for a field called "Lease Term Less Than 1 Year". This field should look at the Start Date and End Date of the lease, and if it is less than 1 year difference, return a YES, otherwise return a NO. I set the following up and thought it was working, but I was mistaken.</p>
<p> </p>
<div>if(BirtDateTime.diffMonth(dataSetRow["T1_RESTARTTODATECONV"],</div>
<div>dataSetRow["T1_REEXPTODATECONV"]) < 12) </div>
<div>{</div>
<div>"Yes"</div>
<div>}</div>
<div>else</div>
<div>{</div>
<div> "No"</div>
<div>}</div>
<div> </div>
<div> </div>
<div>dataSetRow is my end date.</div>
<div> </div>
<div>This will work unless you have a scenario where the difference comes down to days within the 12th month, for instance, if I have a start date of 06/01/2015 and an end date of 06/02/2015, the expression is still returning a yes. I tried setting thi sup using years instead of months, but that also did not work. I thought about using days, but that will present problems with leap years. Any advise? My data set is a SQL query, so it may also be possible to either break the dates down further within the query, or do all of the calculation within the query, but I could not figure that out either.</div>
<div> </div>
<div>I am writing this report using Eclipse Version 3.6.2</div>
Find more posts tagged with
Comments
There are no comments yet