I think my question is not so difficult to answer but can anybody tell me the easiest way to subtract one day from a timestamp value?
being a little oracle minded i tried just adding -1 to the deriviation but when running the job, the job aborts.
How to subtract one day from a timestampvalue?
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
In a server job separate the date and time portions, subtract one day from the day portion, then re-assemble the timestamp.
Code: Select all
Oconv(Iconv(Field(InLink.TheTimestamp, " ", 1, 1), "DYMD") - 1, "D-YMD[4,2,2]") : " " : Field(InLink.TheTimestamp, " ", 2, 3)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 34
- Joined: Fri Jan 19, 2007 9:09 am
- Location: Breda, The Netherlands
I will be using it right away.ray.wurlod wrote:In a server job separate the date and time portions, subtract one day from the day portion, then re-assemble the timestamp.Code: Select all
Oconv(Iconv(Field(InLink.TheTimestamp, " ", 1, 1), "DYMD") - 1, "D-YMD[4,2,2]") : " " : Field(InLink.TheTimestamp, " ", 2, 3)
Thanks Ray.
Greetings Roy