Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 10th, 2006, 10:55 AM
nesans
Guest
 
Posts: n/a
Default 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

  #2  
Old November 10th, 2006, 01:15 PM
Tonkuma
Guest
 
Posts: n/a
Default Re: Conversion of packed data to db2 date


nesans wrote:
Quote:
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

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles