difference between two timestamps

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
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

difference between two timestamps

Post by dodda »

hello

i want to find out the difference between two time stamps

a:2010-01-04 14:10:13
b:2010-01-04 16:22:44

how can i obtain the difference between these 2 time stamps (b-a) in datastage.what would be the resulting datatype. because i need to convert the difference between the timestamps to varchar and insert the value into database.

Thanks
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

Have a look at the date and time help functions, all the answers you need are there...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The difference can only be seconds. This will be a numeric data type of some kind, which can implicitly be converted to string (VarChar) provided that the string maximum size (precision) is sufficiently large.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

Post by dodda »

Hi Ray,

I tried to compute the difference by specifying the difference as Datatype Numeric.i tried with all the datatypes but i am unable to compile the job.

Thanks
ray.wurlod wrote:The difference can only be seconds. This will be a numeric data type of some kind, which can implicitly be converted to string (VarChar) provided that the string maximum size (precision) is sufficiently large.
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

Post by dodda »

Hi

i used secondssincefromtimestamp function to get the difference

thanks
Post Reply