We help IT Professionals succeed at work.
Get Started

time formatting in oracle- output to excel format

Last Modified: 2015-03-10
select s.city_name city,s.state_code  st,
       initcap(mc.udf1)  county,
       to_char(drive_date,'MM/DD/RRRR') drive_date,
	   to_char(start_time,'HH12:MI AM') start_date,
	   to_char(end_time,'HH12:MI AM') end_date,
	   site_name as location,
                   s.addr_1 || '       ' ||s.addr_2 address,
                   first_name||' '||last_name||' '||'('||substr(phone_number,1,3)||')'
	   ||substr(phone_number,4,3)||'-'||substr(phone_number,7) contact,
	   case when coach_drive in ('C', 'M') then 'YES'
	        else 'NO' 
	   END mobile_coach,
	   group_name sponsoring_group,
decode(ONLINE_SCHED_DATE,null,null,'https://ht.heartlandbc.org/donor/schedules/drive_schedule/'||bd.drive_id) as weblink
   from blood_drives bd, sites  s , 
        master_codes mc, area_reps ar,groups g
  where drive_date between '01-mar-2015' and '31-mar-2015'
    and bd.site_code = s.site_code
	and ar.area_rep_id = bd.area_rep_no
	and sponsor_group_code = group_code
	and code_type = 'COUNT'
	and mc.code = s.county_code
	order by 1,4

Open in new window

start date    end date

08:30 AM    01:00 PM

I need the time to be formatted to

8:30 AM       1:00 PM
Watch Question
Database Developer & Administrator
Most Valuable Expert 2011
Top Expert 2012
This problem has been solved!
Unlock 1 Answer and 16 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE