Subtract minutes

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
ds_search2008
Participant
Posts: 75
Joined: Thu Nov 27, 2008 10:12 am

Subtract minutes

Post by ds_search2008 »

Hello all,

I need to subract 5 minutes from a timestamp field. I tried the option

DateData1.TmStpFld - 0.5 hours

Where

DateData1 is the input link
TmStpFld is the Timestamp column

This is not working. I'm sure this is not correct. Could you please correct me and help me in this regard.

Many Thanks & Kind Regards
Aquilis
Participant
Posts: 204
Joined: Thu Apr 05, 2007 4:54 am
Location: Bangalore
Contact:

Post by Aquilis »

DateData1.TmStpFld[1,14]:(Right(DateData1.TmStpFld,5)-05:00)
Aquilis
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Did you test that, Aquilis ?!!

ds_search2008, 0.5 hours and 5 minutes are not the same thing.

Investigate the time conversion functions with "Since" in their names.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Pravenai
Participant
Posts: 49
Joined: Mon Apr 06, 2009 1:32 am
Location: USA

Post by Pravenai »

Hi,

You can try this function
timestampfromsecondssince(-300,<column with timestamp value>)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Teaching someone to fish is always better than giving them a fish.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Aquilis
Participant
Posts: 204
Joined: Thu Apr 05, 2007 4:54 am
Location: Bangalore
Contact:

Post by Aquilis »

My Bad,
you can go with Sincefunctions Or with
DateData1.TmStpFld [1,14]:((Right(DateData1.TmStpFld,5)[1,2])-05):':':Right(DSLink16.Out,2)
Aquilis
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why so sad?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ds_search2008
Participant
Posts: 75
Joined: Thu Nov 27, 2008 10:12 am

Post by ds_search2008 »

Dear experts,

Thanks a lot for all your replies and time. I will try this out. Many thanks and sorry for my late response.

Kind Regards.
ds_search2008
Participant
Posts: 75
Joined: Thu Nov 27, 2008 10:12 am

Post by ds_search2008 »

Great!!!! Its working fine. Thank you all. Thanks a lot. :D

Kind Regards
Post Reply