BirtDateTime calculation wrong? [message #629127] |
Mon, 27 September 2010 06:08  |
Eclipse User |
|
|
|
Originally posted by: abel.macadam.eden.invalid
Hi,
The report I build needs column heading containing the months, starting
with the previous month, the next column two months ago, etc. The
required result would be (as September is the current month)
aug jul jun etc.
(when the output is formatted as Date Time Custom MMM)
I can get this using the following formula:
BirtDateTime.addMonth(BirtDateTime.now(), -1) for the previous month
BirtDateTime.addMonth(BirtDateTime.now(), -2) for two months ago
etc.
However, when I get to:
BirtDateTime.addMonth(BirtDateTime.now(), -10)
I get unexpected results. Instead of
jan
I get
27 nov 2009 12:06
Instead of dec I get 27 okt 2009 12:06
What am I doing wrong?
Abel.
|
|
|
Re: BirtDateTime calculation wrong? [message #629185 is a reply to message #629127] |
Mon, 27 September 2010 08:54  |
Eclipse User |
|
|
|
The function is working correctly. 10 calendar months prior to September 27 is November 27 of the prior year. You just need to either truncate the date or extract the month part of the name for your header.
|
|
|
Powered by
FUDForum. Page generated in 0.05863 seconds