Hi All,
I want to add 1 to the months till my counter reaches 24.
For Example.
SOURCE
LOCATIONID, ITEMID, DATE, QTY1, QTY2.......QTY24
------------------------------------------
1, 2, jan-05, 12, 16.........39
TARGET
LOCATIONID, ITEMID, DATE, ADDED_DATE, QTY
-------------------------------------------
1, 2, jan-05, jan-05, 12
1, 2, jan-05, feb-05, 16
-
-
-
1, 2, jan-05, dec-06, 39
If you see the above example one is added to the date column from the
Source ie.jan-05 and it is been incremented till it reaches dec-06 i.e.24 times based on the qty1--qty24 from the source
Thanks in advance.comments appreciated
Adding 1 to the months
Moderators: chulett, rschirm, roy
Hello this seams like a pivoting question, there are dynamic approaches, which have to be though about deeper, as quick and dirty I will sugest a static approach to you, which is (most of you will blame me) a lot to write but simple.
You set up 24 outlinks and in each field you set up the relevant fields and put them into target.
For to calculate the new Date use the following function:
function addDate(InDate,Number)
NumDate=oconv(iconv(Date,"D-MY"),"D-MY[2,4]")
Month=field(NumDate,"-",1)
Year=field(NumDate,"-",2)
NewMonth=Month+Number
ResMonth=Mod(NewMonth,12)
AddYear=INT(NewMonth/12)
ResYear=Year+AddYear
NewDate=oconv(iconv(ResMonth:"-":ResYear,"D-MY[2,4]"),"D-MY[A3,4]")
Ans=NewDate
Return(Ans)
Hope it is a quick help.
Wolfgang
You set up 24 outlinks and in each field you set up the relevant fields and put them into target.
For to calculate the new Date use the following function:
function addDate(InDate,Number)
NumDate=oconv(iconv(Date,"D-MY"),"D-MY[2,4]")
Month=field(NumDate,"-",1)
Year=field(NumDate,"-",2)
NewMonth=Month+Number
ResMonth=Mod(NewMonth,12)
AddYear=INT(NewMonth/12)
ResYear=Year+AddYear
NewDate=oconv(iconv(ResMonth:"-":ResYear,"D-MY[2,4]"),"D-MY[A3,4]")
Ans=NewDate
Return(Ans)
Hope it is a quick help.
Wolfgang
Hi,
First there is no need to post in both EE and Server forum.
second take a look at this.
I found this after a few minits of using the search mechanism
IHTH,
First there is no need to post in both EE and Server forum.
second take a look at this.
I found this after a few minits of using the search mechanism
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org