Hi All,
I am trying to convert the date value as in source the field is in NVarchar and in target (SQL) the field is in Timestamp. I need to convert the value like 1/10/08 9:33 (from source) to timestamp (in target). Tried string to timestamp and left function and all..I am missing some simple logic here....Thanks in advance!
converting timestamp
Moderators: chulett, rschirm, roy
converting timestamp
Suriv
No one is perfect... that's why pencils have erasers
No one is perfect... that's why pencils have erasers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You need to re-assemble the various components of the source string into a timestamp format, and then apply a StringToTimestamp() function. One issue that you'll need to address is a consistent, two-digit, format for month and day; another is the business rule for the century in which a two-digit year occurs; a third is adding seconds to the timestamp format.
It's do-able, it's not difficult, but it IS tedious (but you only have to do it the once).
It's do-able, it's not difficult, but it IS tedious (but you only have to do it the once).
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.
-
- Charter Member
- Posts: 193
- Joined: Tue Sep 05, 2006 8:01 pm
- Location: Australia