I have a string "2011-01-05 06:10:30,339" that I try to move to a timestamp field but no matter what I try the milliseconds are getting cut off. The timestamp is defined as timestamp len=23 scale=3.
inside a transformmer I've tried:
StringToTimestamp(field,"%yyyy-%mm-%dd %hh:%nn:%ss,%SSS")
StringToTimestamp(field,"%yyyy-%mm-%dd %hh:%nn:%ss.3")
and nothing is working as I keep getting the timestamp without milliseconds
2011-01-05 06:10:30
any advice?
thanks
Can't get milliseconds on my timestamp
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Try
or or
Code: Select all
StringToTimestamp(field,"%yyyy-%mm-%dd %hh:%nn:%ss,3")
Code: Select all
StringToTimestamp(field,"%yyyy-%mm-%dd %hh:%nn:%ss,%sss")
Code: Select all
StringToTimestamp(Convert(",",".",field),"%yyyy-%mm-%dd %hh:%nn:%ss.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.
Thanks for the response. I tried those as well. I just did happen to stumble on to the issue. In the 'Extended' column within the transformmer I had to select miroseconds and it worked when writing to the database. When writing to the file I had to select miroseconds as well. In addition on the sequential file stage I had to put the format of the timestamp as well for it to write to the file. ,"%yyyy-%mm-%dd %hh:%nn:%ss,%SSS") .
Then when i extracted from the table just to see if it worked again i had to set the extended to microseconds there too.
Then when i extracted from the table just to see if it worked again i had to set the extended to microseconds there too.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: