string conversion to timestamp
Moderators: chulett, rschirm, roy
string conversion to timestamp
I have source defined as time stamp.But I am getting only date now...later I may get complete time stamp.I am using stringtotimestamp function to convert it using format ,["%yyyy-%mm-%dd %hh:%nn:%ss".Since I am not getting time along with how can I am appending :00:00:00.How can I handle when it comes as complete time stamp in future.( I can not keep append/hard code with 00:00:00).
You can check if the length of the input string.
The above code will work only if the input is a timestamp or just the date.
Code: Select all
If len(trim(In.Field)) = 19 Then StringToTimespamp(In.Field,"%yyyy-%mm-%dd %hh:%nn:%ss") Else StringToTimespamp(In.Field : " 00:00:00","%yyyy-%mm-%dd %hh:%nn:%ss")
Ping me if I am wrong...