开发者

Text to Date & time

I have two field, Date and Time. Both are Text formated. I need to bring them togeather as a date/time format开发者_JAVA技巧 so we can caluate time used. We are using current date/time - the text date/time. What is the best way to change the format of the date time text fields into one field that has a date/time format. Thank you


select to_date (date_field || time_field, 'xxx') from ...

Change 'xxx' to the format that matches the concatenated value. For example, if date_field is like '01-JAN-2010' and time_field is like '23:49:12' then:

select to_date (date_field || time_field, 'DD-MON-YYYYHH24:MI:SS') from ...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜