Page 1 of 1

Date Conversion

Posted: Mon May 05, 2008 11:24 am
by shrey3a
Hi Gurus,

We have date from source in packed format the data type is
S(9) 7 COMP-3 and it will always be 7 chr long. Below is the few conversion

1060101 2006-01-01
0060101 1906-01-01
-1060101 1806-01-01

I tried every sort of onversion but somehow not able to get results.

Regards,

Posted: Mon May 05, 2008 1:27 pm
by Aruna Gutti
Did you tried using combination of substring and Concatenation and arrive at your own conversion logic ?

Posted: Mon May 05, 2008 4:23 pm
by ray.wurlod
Except that, when there's a sign, it's eight characters long.

The year is given by something like

Code: Select all

2000+Mod(InLink.TheInteger,1000000)+Mod(Int(InLink.TheInteger/1000000),10000)
The month and day can be extracted using integer division and remainder or by substring techniques.
Then re-assemble the date as a string and, if required, convert that to a Date data type.

Posted: Wed May 07, 2008 6:20 am
by epernay
there are only 3 rows?
if yes, you can try "the first numbe+19":
1+19=20
0+19=19
-1+19=18

Posted: Wed May 07, 2008 6:22 am
by epernay
there are only 3 rows?
if yes, you can try "the first numbe+19":
1+19=20
0+19=19
-1+19=18

Posted: Fri May 23, 2008 6:41 am
by G SHIVARANJANI
hi..

It s great if you can share the resolution with us.