Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Trying to create a report variable that returns yesterday's date in yyyy-MM-dd format
Trying to create a report variable that returns yesterday's date in yyyy-MM-dd format [message #756986] Tue, 15 November 2011 20:35 Go to next message
Todd  is currently offline Todd
Messages: 4
Registered: November 2011
Junior Member
I am new to this and I am trying to create a variable on a report that will return yesterday's date formatted yyyy-MM-dd and have had no luck. Any help would be appreciated. I have tried
BirtDateTime.year(BirtDateTime.now()) + "-" + BirtDateTime.month((BirtDateTime.now()) + "-" BirtDateTime.day(BirtDateTime.now())

and it will return today's date in the required format, but I can't get it to pull yesterday (and it doesn't seem like the correct way to get this to work).

The reason I am looking for a variable is so that I can use it in a number of filters for the report that all require yesterdays date in that format.

thanks
Re: Trying to create a report variable that returns yesterday's date in yyyy-MM-dd format [message #756989 is a reply to message #756986] Tue, 15 November 2011 21:18 Go to previous message
Todd  is currently offline Todd
Messages: 4
Registered: November 2011
Junior Member
I found a solution
Formatter.format(BirtDateTime.addDay(BirtDateTime.today(),-1), "YYYY-MM-dd")

Previous Topic:Encoding a report design in another xml?
Next Topic:birt chart accessibility options
Goto Forum:
  


Current Time: Mon Sep 22 02:20:13 GMT 2014

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

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