Extra characters at the end of a datetime or interval
Moderators: chulett, rschirm, roy
Extra characters at the end of a datetime or interval
I am getting the following message in Datastage Director "Extra characters at the end of a datetime or interval".
Incoming date format is: 2000-09-07 09:26:27.000 ,i want to convert it to 2000-09-07 09:26:27 for comparing the date field with the date field in the table. Please provide a solution
Incoming date format is: 2000-09-07 09:26:27.000 ,i want to convert it to 2000-09-07 09:26:27 for comparing the date field with the date field in the table. Please provide a solution
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Code: Select all
Left(TheTimestamp, 19)
Code: Select all
Field(TheTimestamp, ".", 1, 1)
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I'm a big fan of efficiency and ease of maintenance.
All that's required is to lose the milliseconds from a timestamp.
Iconv() and Oconv() don't work with timestamps, so that you'd need to do some string manipulation in any case.
All that's required is to lose the milliseconds from a timestamp.
Iconv() and Oconv() don't work with timestamps, so that you'd need to do some string manipulation in any case.
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.
What type of database are you dealing with? What is the length of timestamp there? If it supports milliseconds, then i would say keep your milliseconds in tact if your going for a string comparison.
In the end, 2000-09-07 09:26:27.000 is different than
2000-09-07 09:26:27.003![Wink :wink:](./images/smilies/icon_wink.gif)
In the end, 2000-09-07 09:26:27.000 is different than
2000-09-07 09:26:27.003
![Wink :wink:](./images/smilies/icon_wink.gif)
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Hi Ray,ray.wurlod wrote:orCode: Select all
Left(TheTimestamp, 19)
...Code: Select all
Field(TheTimestamp, ".", 1, 1)
Thanks.
This is working fine.But i dont know why 000 is appended at the end of the time stamp ,As it is declared timestamp 19 in source and target and bith are same table.
[/b]
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: