Hey,
I have a timestamp column comming in from a source file as:
2006-02-01 00.00.00.000000
I need to have it come out as:
2006-02-01-00.00.00.000000
Currently my stage is doing a seq to seq. How do I format the timestamp properly?
Thanks,
Steve
Timestamp Formatting
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
Hi Steve,
You can also accomplish it by using the Ereplace function.
Ereplace (string, substring, replacement [ ,number [ ,begin] ] )
string is the string or expression.
substring is the substring you want to replace. If substring is an empty string, the value of string is returned.
replacement is the replacement substring. If replacement is an empty string, all occurrences of substring are removed.
number specifies the number of instances of substring to replace. To change all instances, use a value less than 1.
start specifies the first instance to replace. A value less than 1 defaults to 1.
you can code your derivation this way:
Thanks,
Naveen.
You can also accomplish it by using the Ereplace function.
Ereplace (string, substring, replacement [ ,number [ ,begin] ] )
string is the string or expression.
substring is the substring you want to replace. If substring is an empty string, the value of string is returned.
replacement is the replacement substring. If replacement is an empty string, all occurrences of substring are removed.
number specifies the number of instances of substring to replace. To change all instances, use a value less than 1.
start specifies the first instance to replace. A value less than 1 defaults to 1.
you can code your derivation this way:
Code: Select all
DT_FLD = Ereplace(Trim(InLink.DT_FLD, " ", "-")
Naveen.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
Oops! Sorry.
I missed a parethesis in the code. It should be
Let me know if it worked.
Thanks,
Naveen.
I missed a parethesis in the code. It should be
Code: Select all
DT_FLD = Ereplace(Trim(InLink.DT_FLD), " ", "-")
Thanks,
Naveen.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
-
- Participant
- Posts: 11
- Joined: Tue Jan 10, 2006 2:33 pm
naveendronavalli wrote:Oops! Sorry.
I missed a parethesis in the code. It should be
Let me know if it worked.Code: Select all
DT_FLD = Ereplace(Trim(InLink.DT_FLD), " ", "-")
Thanks,
Naveen.
Thanks alot Naveen. Works great! :D