Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to add timestamp field as time to existing timestamp?

2947943May 13 2015 — edited May 13 2015

Hello,

I am trying to add timestamp field(but I need to extract only time) and add it to date that I want to format as timestamp? It should be something like this

SELECT

  *

  FROM

  ontime_pro_dtl a, window_xref b

  WHERE

  b.window_nm = 'OT-HUB-AR'

  AND TO_CHAR(cast(A.bid_ariv_tmstp as date),'DD-MON-YY') between B.eff_dt and B.expr_dt

  and a.bid_ariv_tmstp >= to_date(to_date(current_date,'dd-mon-yy')||to_char(cast(b.start_tm as date),'hh24:mi:ss'),'dd-mon-yy hh24:mi:ss')

  AND DSPCH_DEST_LOC_CD = 'LIT'

So I need to take b.start_tm, extract the time portion of it and add it to my current_date that I need to format as timestamp? I tried many different things, but no luck.. Any ideas? Thanks in advance!

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 10 2015
Added on May 13 2015
5 comments
915 views