timestamp to integer
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 96
- Joined: Fri Aug 20, 2010 8:51 am
timestamp to integer
hi
I am having a source column as timestamp and my target column is integer.
column
2011-07-29 00:00:00.000
in xfm
I am doing
in.column[1,4]:in.column[6,7]:in.column[9,10] but is is giving me 0 in the output
I did this beofre it worked long back but now it is not working.could you tell me what is the problem.Thanks all
I am having a source column as timestamp and my target column is integer.
column
2011-07-29 00:00:00.000
in xfm
I am doing
in.column[1,4]:in.column[6,7]:in.column[9,10] but is is giving me 0 in the output
I did this beofre it worked long back but now it is not working.could you tell me what is the problem.Thanks all
-
- Premium Member
- Posts: 96
- Joined: Fri Aug 20, 2010 8:51 am
-
- Premium Member
- Posts: 96
- Joined: Fri Aug 20, 2010 8:51 am
-
- Participant
- Posts: 96
- Joined: Mon May 14, 2012 1:30 pm
Initially you will have to convert the TimeStamp to String using TimestampToString(%timestamp%,[%"%yyyy-%mm-%dd %hh:%nn:%ss"%]) function.
After wards you can apply your substring function. But, as Chulett said your syntax is wrong. It should be as shown below:
in.column[1,4]:in.column[6,2]:in.column[9,2]
And later on if you need then you can convert this String to Decimal.
After wards you can apply your substring function. But, as Chulett said your syntax is wrong. It should be as shown below:
in.column[1,4]:in.column[6,2]:in.column[9,2]
And later on if you need then you can convert this String to Decimal.
Once more with feeling - you have (as one example) "in.column[6,7]" where you are telling it to substring from position 6 to position 7. That is not the correct syntax. You need to tell it to start in position 6 and substring out 2 characters: "in.column[6,2]"
Once they are all correct, you should be much closer to your goal.
Once they are all correct, you should be much closer to your goal.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
@chullet
Here source is Timestamp so can i apply substring operator directly or do i need to convert Timestamp to string and then i need to apply substring operator
As per my knowledge we can not apply substring operator directly to timestamp we need to convert timestamp to string before applying substring operator.Please correct me if i am wrong?
Here source is Timestamp so can i apply substring operator directly or do i need to convert Timestamp to string and then i need to apply substring operator
As per my knowledge we can not apply substring operator directly to timestamp we need to convert timestamp to string before applying substring operator.Please correct me if i am wrong?
-
- Premium Member
- Posts: 96
- Joined: Fri Aug 20, 2010 8:51 am
-
- Premium Member
- Posts: 353
- Joined: Mon Jan 17, 2011 5:03 am
- Location: Mumbai, India
No need to use substr and then concatenating your column.
This will work too
This will work too
Code: Select all
TimestampToString(%timestamp%,["%yyyy%mm%dd"])
Thanx and Regards,
ETL User
ETL User