Author |
Message
|
CoolDude |
Posted: Tue Aug 10, 2004 8:48 pm Post subject: Using Interval |
|
|
Apprentice
Joined: 17 Jan 2004 Posts: 39
|
Folks,
I would like to subtract 3 months from the date
here is my code
DECLARE tmpDate DATE DATE'2004-07-31';
SET OutputRoot.XML.OutDate = tmpDate - INTERVAL '3' MONTH;
I am recieving this error
Code: |
RecoverableException BIP2327E: Invalid fields for Gregorian date value: Year '2004'; Month '4'; Day '31'.
An attempt was made to interpret the following fields as a valid date in the Gregorian calendar. Year: 2004, Month: 4, Day: 31. (January is represented by a month value of 1.)
Correct the message flow definition to ensure that the values being provided as a date value are correct. This may involve validating that data being read from either a database or a message content is suitable for use as a date. |
used the code to highlight the exception.
Let me know what can be done. _________________ Correct Me from Wrong . If i am correct Appreciate Me  |
|
Back to top |
|
 |
wooda |
Posted: Wed Aug 11, 2004 1:05 am Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
Hi,
I think this is a bug.
You should raise a problem with IBM.
Maybe they already have a fix for this.
I tried it on V5 CSD3 (ie. the latest version available) and it still happened.
In the meantime I guess the only solution would be to write a function in ESQL to intelligently add intervals to dates. |
|
Back to top |
|
 |
PGoodhart |
Posted: Wed Aug 11, 2004 5:18 am Post subject: |
|
|
Master
Joined: 17 Jun 2004 Posts: 278 Location: Harrisburg PA
|
April doesn't have 31 days!
Hence bad date. _________________ Patrick Goodhart
MQ Admin/Web Developer/Consultant
WebSphere Application Server Admin |
|
Back to top |
|
 |
wooda |
Posted: Wed Aug 11, 2004 6:38 am Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
Bravo PGoodhart.
However you slightly missed the point.
If you subtract 3 months from a date you would expect the result to be a valid date.
So
'2004-07-31' - 3 months
equals either '2004-04-30' or '2004-05-01' but not '2004-04-31'
The broker needs to sensibly handle this eventuality or else arithmatic on dates requires lots of unecessary custom code. |
|
Back to top |
|
 |
Craig B |
Posted: Mon Aug 16, 2004 5:31 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
Hi,
This is a defect in the product and there is APAR IC38466 that is aiming to fix this in a future fix pack. If you raise a PMR with IBM support you should be able to get a fix for this problem.
Regards
Craig _________________ Regards
Craig |
|
Back to top |
|
 |
|