Calculating Date -1 from Timestamp

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
nvuradi
Participant
Posts: 54
Joined: Tue Dec 12, 2006 11:03 pm

Calculating Date -1 from Timestamp

Post by nvuradi »

hi i have a requirement where in i have to calculate the previous day from the timestamp from the source.

I have tried using timestamptodate(TS) - 1, then realised that it is not possible.

i have tried using SecondsSinceFromTimestamp, but to no avail.

can anyone help me with the right approach.

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

Post by ArndW »

The TimeStampFromSecondsSince() will help you. There are 60*60*24 seconds in a day.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Moderator: please move to parallel forum
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nvuradi
Participant
Posts: 54
Joined: Tue Dec 12, 2006 11:03 pm

Post by nvuradi »

sorry by mistake i included this as a part of the server forum.

here is what i used to get the previous day from the Timestamp

DateFromDaysSince(-1,TimestampToDate(UPDT_TS))

thank you all
naru
Post Reply