Duducting Some Minutes from a TIMESTAMP field

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
bapajju
Participant
Posts: 82
Joined: Wed Nov 19, 2003 11:58 pm

Duducting Some Minutes from a TIMESTAMP field

Post by bapajju »

HI,

I have a timestamp field in the format as : yyyy-mm-dd hh24:mm:ss. Now I have another input field called MINUTES (Decimal (5,0)) and this field essentially contains values like 10,20,30... which are essentially number of minutes. I need to deduct this value from the timestamp field and put into an output field which is also an timestamp field. Kindly let me know how to achieve this.

Thanks in advance.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

You'll have to write your own. You may want to look here:
viewtopic.php?t=85788
to get a headstart. This function subtracts two timestamps. You basically have to subtract minutes and deal with rolling under hours and potentially days. Write a good function and post it for all to share! :D
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
bapajju
Participant
Posts: 82
Joined: Wed Nov 19, 2003 11:58 pm

Post by bapajju »

Yup Boss. I will. Thanks for the help. Appreciate your help.
kcbland wrote:You'll have to write your own. You may want to look here:
viewtopic.php?t=85788
to get a headstart. This function subtracts two timestamps. You basically have to subtract minutes and deal with rolling under hours and potentially days. Write a good function and post it for all to share! :D
ogmios
Participant
Posts: 659
Joined: Tue Mar 11, 2003 3:40 pm

Post by ogmios »

If both the date and minutes come from the same database and the calculation is not complex, do the calculation in the database :wink:

Ogmios
In theory there's no difference between theory and practice. In practice there is.
Post Reply