• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1426
  • Last Modified:

combining a date field with a time field 2 different formats - Oracle

Good Afternoon Experts,
 I need some assistance on how to combine to fields together.

I have a field that is called surgery_start_date which a date field that shows as such:

8/25/2013 12:00:00 am

the other field called surgery_start_time is a vchar(5) fields with show the following
08:45

what I need is for to show up as

08/25/2013 08:45

how can this be achieved?  thanks in advance.
0
Butterfly2
Asked:
Butterfly2
1 Solution
 
slightwv (䄆 Netminder) Commented:
select to_char(surgery_start_date,'MM/DD/YYYY') || ' ' || surgery_start_time from table;
0
 
johnsoneSenior Oracle DBACommented:
That would work for display purposes.  If you wanted to do any kind of date math with it, you would need to turn the combined fields into a date like this:

to_date(to_char(surgery_start_date,'mmddyyyy')||surgery_start_time, 'mmddyyyyhh24:mi')
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now