Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » month ago(Parameters)
month ago [message #1739682] Wed, 03 August 2016 18:37
Aaron Easton is currently offline Aaron EastonFriend
Messages: 3
Registered: August 2016
Junior Member
I have a report that i did not build. The issue that i have is how it looks at the parameter date and time when it looks back a month ago. I just need it to look at the 1st and the last day. I am not worry about the time stamp.

Here is the report parameters:

importPackage( );
var sqlText = new String();
var myDF1 = new SimpleDateFormat("MM/dd/yyyy", reportContext.getLocale());
var cMonth = new String();
var cMonth2 = new String();
var cMonth3 = new String();
var cMonth6 = new String();
var cMonth8 = new String();

var nDate1 = new Date();
var nDate2 = new Date();
var nDate3 = new Date();


if(params["MonthAgo"].value==0) {
cMonth3=" ";
cMonth6=" AND (1=2) ";
} else {
cMonth3=" AND (READINGDATE<DATE(TIMESTAMP_FORMAT('"+myDF1.format(nDate2)+"','MM/DD/YYYY'))) ";
cMonth6=" AND (READINGDATE>=DATE(TIMESTAMP_FORMAT('"+myDF1.format(nDate2)+"','MM/DD/YYYY'))) ";
cMonth8="DATE(TIMESTAMP_FORMAT('"+myDF1.format(nDate3)+" 23:59:59','MM/DD/YYYY HH24:MI:SS'))";

cMonth= " (REPORTDATE>=DATE(TIMESTAMP_FORMAT('"+myDF1.format(nDate1)+"','MM/DD/YYYY'))) AND (REPORTDATE<DATE(TIMESTAMP_FORMAT('"+myDF1.format(nDate2)+"','MM/DD/YYYY'))) ";
cMonth2=" (ft.DATEFLT>=DATE(TIMESTAMP_FORMAT('"+myDF1.format(nDate1)+"','MM/DD/YYYY'))) AND (ft.DATEFLT<DATE(TIMESTAMP_FORMAT('"+myDF1.format(nDate2)+"','MM/DD/YYYY'))) ";

I need some help on getting the last month only. Thanks for any help.
  • Attachment: report.txt
    (Size: 15.80KB, Downloaded 99 times)
Previous Topic:Report Parameters
Next Topic:How to use Flatfilename as Variable?!
Goto Forum:

Current Time: Fri Aug 07 21:04:31 GMT 2020

Powered by FUDForum. Page generated in 0.01483 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top