Hi,
Can you please tell us how to add months to Date format in Server Edition using OCONV(ICONV....
Thanks in Advance,
Sridhar.
Adding months to Date in Server Edition
Moderators: chulett, rschirm, roy
Depends on your definition of 'month'. Typically, you either add a number of days to the date or break it up into component pieces and bump the month (and perhaps year and day) individually. Both Ray and Ken have routines to do this available for download, from what I recall.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Re: Adding months to Date in Server Edition
[quote="sridharvg"]Hi,
Can you please tell us how to add months to Date format in Server Edition using OCONV(ICONV....
Thanks in Advance,
Sridhar.[/quote]
Hi
you can try this..
First Convert the date to month format..
like Oconv(date(),"D-M") result is 1 or 2 or ...12 based on the system date
For Eg:today's date 26-11-2008---->11
then add the number i.e., which month u want the date to be..
Like if u need DEC then add 1
Finally the expression will be
OConv(IConv(Oconv(date(),"D-M")+1),"D-M"),"D-YMD[4,2,2]")
I guess..this gives you the 1st dec date
Can you please tell us how to add months to Date format in Server Edition using OCONV(ICONV....
Thanks in Advance,
Sridhar.[/quote]
Hi
you can try this..
First Convert the date to month format..
like Oconv(date(),"D-M") result is 1 or 2 or ...12 based on the system date
For Eg:today's date 26-11-2008---->11
then add the number i.e., which month u want the date to be..
Like if u need DEC then add 1
Finally the expression will be
OConv(IConv(Oconv(date(),"D-M")+1),"D-M"),"D-YMD[4,2,2]")
I guess..this gives you the 1st dec date
Re: Adding months to Date in Server Edition
[quote="sridharvg"]Hi,
Can you please tell us how to add months to Date format in Server Edition using OCONV(ICONV....
Thanks in Advance,
Sridhar.[/quote]
Hi
you can try this..
First Convert the date to month format..
like Oconv(date(),"D-M") result is 1 or 2 or ...12 based on the system date
For Eg:today's date 26-11-2008---->11
then add the number i.e., which month u want the date to be..
Like if u need DEC then add 1
Finally the expression will be
OConv(IConv(Oconv(date(),"D-M")+1),"D-M"),"D-YMD[4,2,2]")
I guess..this gives you the 1st dec date
Can you please tell us how to add months to Date format in Server Edition using OCONV(ICONV....
Thanks in Advance,
Sridhar.[/quote]
Hi
you can try this..
First Convert the date to month format..
like Oconv(date(),"D-M") result is 1 or 2 or ...12 based on the system date
For Eg:today's date 26-11-2008---->11
then add the number i.e., which month u want the date to be..
Like if u need DEC then add 1
Finally the expression will be
OConv(IConv(Oconv(date(),"D-M")+1),"D-M"),"D-YMD[4,2,2]")
I guess..this gives you the 1st dec date
Re: Adding months to Date in Server Edition
[quote="sridharvg"]Hi,
Can you please tell us how to add months to Date format in Server Edition using OCONV(ICONV....
Thanks in Advance,
Sridhar.[/quote]
Hi
you can try this..
First Convert the date to month format..
like Oconv(date(),"D-M") result is 1 or 2 or ...12 based on the system date
For Eg:today's date 26-11-2008---->11
then add the number i.e., which month u want the date to be..
Like if u need DEC then add 1
Finally the expression will be
OConv(IConv(Oconv(date(),"D-M")+1),"D-M"),"D-YMD[4,2,2]")
I guess..this gives you the 1st dec date
Can you please tell us how to add months to Date format in Server Edition using OCONV(ICONV....
Thanks in Advance,
Sridhar.[/quote]
Hi
you can try this..
First Convert the date to month format..
like Oconv(date(),"D-M") result is 1 or 2 or ...12 based on the system date
For Eg:today's date 26-11-2008---->11
then add the number i.e., which month u want the date to be..
Like if u need DEC then add 1
Finally the expression will be
OConv(IConv(Oconv(date(),"D-M")+1),"D-M"),"D-YMD[4,2,2]")
I guess..this gives you the 1st dec date
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Try the AddMonths routine from here
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.