TimeStamp problem
Posted: Mon Jan 08, 2007 11:28 pm
Hi All
I am getting below problem plz look in to this.
My Database is: SQL Server2005
Target_column_Datatype: Datetime
Source
Posting_time
--------
200607
200708
210708
In Derivation:
If Len(DSLink6.POSTING_TIME) <>6 Then "1900-01-01 00:00:00" Else Left(DSLink6.POSTING_TIME,2) : ":" : Left(Right(DSLink6.POSTING_TIME,4),2) : ":" : Right(DSLink6.POSTING_TIME,2)
I am handling this convertion through above logic but here my problem is if length of the Posting_Time not equal to 6, then i need to hardcode by "1900-01-01 00:00:00 else i need to convert the Posting_time as 20:06:07. If I put target column datatype as NVarchar or Varchar it's working fine. But the target column is Timestamp.It's not converting the above logic. Any help for this Query.
Regards,
Kondeti
I am getting below problem plz look in to this.
My Database is: SQL Server2005
Target_column_Datatype: Datetime
Source
Posting_time
--------
200607
200708
210708
In Derivation:
If Len(DSLink6.POSTING_TIME) <>6 Then "1900-01-01 00:00:00" Else Left(DSLink6.POSTING_TIME,2) : ":" : Left(Right(DSLink6.POSTING_TIME,4),2) : ":" : Right(DSLink6.POSTING_TIME,2)
I am handling this convertion through above logic but here my problem is if length of the Posting_Time not equal to 6, then i need to hardcode by "1900-01-01 00:00:00 else i need to convert the Posting_time as 20:06:07. If I put target column datatype as NVarchar or Varchar it's working fine. But the target column is Timestamp.It's not converting the above logic. Any help for this Query.
Regards,
Kondeti