View previous topic :: View next topic
|
Author |
Message |
rohinigowda
New User
Joined: 29 Mar 2007 Posts: 1 Location: Bangalore
|
|
|
|
Hi,
I need to calculate next year date by using current syatem date.
ex: todays date i will be getting in RUN-CCYY and i want to calculate tax for next year ?
ws-hold-ccyy = RUN-CCYY +1
is it correct to calculate the same. This process always runs before 01/01/xx or the beginning of the new year. it depends on the client. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Rohini,
Quote: |
This process always runs before 01/01/xx or the beginning of the new year |
Quote: |
ws-hold-ccyy = RUN-CCYY +1 |
True if you run the program before the new year..... but not for the second case. |
|
Back to top |
|
|
skkp2006
New User
Joined: 14 Jul 2006 Posts: 93 Location: Chennai,India
|
|
|
|
How about trying the same using DB2
Code: |
SELECT CURRENT DATE + 1 YEAR
FROM SYSIBM.SYSDUMMY1; |
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Quote: |
is it correct to calculate the same. This process always runs before 01/01/xx or the beginning of the new year. it depends on the client. |
The process has been discussed a few times...
first things to consider ...
DATES ARE TRICKY TO WORK ON..
it makes no sense to carry on normal arithmetic operations on them
adding 1 to the day might go to next month
adding one to the month might go to next year
adding one to the year might switch to/from a leap year
( if You subtract c/next/previous)
the Business needs and constraints must be clearly understood
before a solution can be safely implemented |
|
Back to top |
|
|
|