time stamp

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
arshi
Participant
Posts: 50
Joined: Wed Apr 18, 2007 5:12 am

time stamp

Post by arshi »

Hi,

How to develop the logic ,I have a table with columns (EmpNo,Ename,Join Time,DeptNo).I have to sum up all the employees join timein all the departments.This Jointime column datatype is Timestamp.

regards,
Arshi
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You can do it with simple SQL directly in the SELECT statement, or use the aggregator stage in DataStage to do this.
arshi
Participant
Posts: 50
Joined: Wed Apr 18, 2007 5:12 am

Post by arshi »

Hi,

I am unable to get through Aggregator because data is in timestamp format.So,unable to add.

Regards,
Arshi
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Post by sachin1 »

change the datatype for timestamp column to varchar it will work.
vivekgadwal
Premium Member
Premium Member
Posts: 457
Joined: Tue Sep 25, 2007 4:05 pm

Post by vivekgadwal »

sachin1 wrote:change the datatype for timestamp column to varchar it will work.
Remove the delimiters and spaces between the timestamps (using "Field" fn.) and then pass them into aggregator stage. (Ex: '2008-05-26 00:00:00' should be represented as '20080526000000').
Vivek Gadwal

Experience is what you get when you didn't get what you wanted
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

I am just curious here... What kind of a situation would demand a "sum of timestamps" :?

Anyway, I think changing it to varchar, or removing the colons is not gonna work (My assumption here is that you want to do sum the dates as "dates" NOT as "integers" ).

What are you going to do after you aggregate all the dates? join them back to the original flow? if yes, how do you want to join it? or do you want just a single row with the aggregated date?
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You simply can not sum dates or timestamps. You need to derive another field, such as length of service, and sum that.
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