cancel
Showing results for 
Search instead for 
Did you mean: 

varchar to timestamp conversion

Former Member
0 Kudos

Hi Experts,

In the source there are fields as below

1. a.cc varchar(2)

2.a.yy  varchar(2)

3.a.mm varchar(2)

4.a.dd varchar(2)

5.a.hh varchar(2)

6.a.mi varchar(2)

7.a.ss varchar(2)

In the target there is a field ttttt with datatype timestamp

Need help on this how to convert

Thanks

Madhu

Accepted Solutions (1)

Accepted Solutions (1)

akhileshkiran
Contributor
0 Kudos

Hi ,

As you mentioned above fields am just showing you a example.

If your source is like this in varchar format.

Here am using two query Transforms to make your output

in the below Query Transform am concatenating fields in the YYYY-MM-DD HH:MM:SS format to target varchar data-type.

In the second Query transform am converting this above filed to to_date format. As target data-type to timestamp

Output:

Regards,

Akhileshkiran.

Former Member
0 Kudos

Thanks Akhileshkiran, It worked

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks everyone it worked

former_member205887
Active Participant
0 Kudos


Provide the same data, your question is not clear.

If your question is different columns in source is holding the parts of a timestamp field then how to convert it to timestamp ?

Then concat the fields in the format of DD-MON-YYYY HH24:MI:SS and use to_date to convert Varchar(String) data to Date