Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Need function to compute Week ending date
trp
Hello all,
I'm new to BIRT reports. Please pardon if this question is repeated.
I'm using BIRT (version 2.2.1.v20070709-110-s332Aw31181_24) with IBM Clearquest (v7.1).
For one report, I need to compute the 'Week Ending date' of a 'submit date' column. I checked the standard date functions and didn't find a function to compute the week ending date.
If there is truly no such function, can someone please forward me the code if they have it handy?
thanks in advance,
Find more posts tagged with
Comments
mwilliams
Hi trp,
I don't believe there's a function to do this in BIRT. You can probably google and find some things people have done to find the last day of a particular week. You could use the week() and dayofweek() functions to help you determine what date is the last date of a week.
johnw
Use the standard Java Gregorian Calendar class. Something like:
///////////////////////////////////////////////////////////////////////////
var calendar = new java.util.GregorianCalendar();
calendar.setTime(new Date());
while (calendar.get(Calendar.DAY_OF_WEEK) < Calendar.SATURDAY)
{
calendar.add(Calendar.DAY, 1);
}
return calendar.getTime();
////////////////////////////////////////////////////////////////////////////
It will take some playing around with, but it should work.
John