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
time stamp
Moderators: chulett, rschirm, roy
You can do it with simple SQL directly in the SELECT statement, or use the aggregator stage in DataStage to do this.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Premium Member
- Posts: 457
- Joined: Tue Sep 25, 2007 4:05 pm
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').sachin1 wrote:change the datatype for timestamp column to varchar it will work.
Vivek Gadwal
Experience is what you get when you didn't get what you wanted
Experience is what you get when you didn't get what you wanted
-
- Participant
- Posts: 467
- Joined: Tue Mar 20, 2007 6:36 am
- Location: Chennai
- Contact:
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?
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>
<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>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: