470,636 Members | 1,555 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,636 developers. It's quick & easy.

Conversion of packed data to db2 date

I have date stored in table as following example:

115514 Equates to March 14, 1996

it is stored from the date of 1900-01-01 to 1996-03-14

Month/Year = 1155 and day = 14

96 X 12 = 1152 + 3 = 1155

I want to be able to convert this to actual date using DB2

Please help

Thanks

N. Sinnadurai

Nov 10 '06 #1
1 2567

nesans wrote:
115514 Equates to March 14, 1996

it is stored from the date of 1900-01-01 to 1996-03-14

Month/Year = 1155 and day = 14

96 X 12 = 1152 + 3 = 1155

I want to be able to convert this to actual date using DB2
Is this homework?
If not, you should have considered the way to convert packed date to
db2 date bofore you put data in a table with packed data format.
DATE('1900-01-01') + (packed_date/100-1) months +
(MOD(packed_date,100)-1) days

Nov 10 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

56 posts views Thread by ccwork | last post: by
reply views Thread by =?Utf-8?B?RGVuaXMgU29oZXQ=?= | last post: by
5 posts views Thread by Praveena P | last post: by
???
1 post views Thread by Stoney L | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.