Date to Integer Conversion in Db2 query

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Suman
Participant
Posts: 53
Joined: Thu Oct 07, 2004 8:28 am

Date to Integer Conversion in Db2 query

Post by Suman »

I have to convert date in db2 table into integer in a query.Is there any function available for this conversion? The date format is mm/dd/yyyy and I want the number of days from a low date 01/01/0001.

Thanks,
Suman
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

More of a database than a DataStage question. If I was in your shoes, I'd start by chatting up my DBA. Or posting this question in some kind of a DB2 support forum. And posting here, of course, someone will probably know. :wink:

I'm guessing you could also write your own, incorporate it into the job itself.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

There are a few date/timestamp manipulation function in UDB. Your best bet would be google.
Check this site out for a start. Also the IBM's public library.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try the DaysSinceFromDate() function.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply