Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » 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 Friend
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 Friend
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: Thu Apr 25 21:53:30 GMT 2024

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

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

Back to the top