Solved

oracle query

Posted on 2012-03-30
4
365 Views
Last Modified: 2012-03-30
select ds.schedule_date,ds.start_hours||':'||ds.start_minutes||ds.start_ampm start_time,  
       ds.end_hours||':'||ds.end_minutes||'0'||ds.end_ampm end_time,
       first_name || ',' || mail_last_name new_name,
         ds.position,reason_code
from dept_staff ds, emp_unexcld eu
where ds.payroll_id = eu.payroll_id
and ds.schedule_date = '01-apr-2012'
order by schedule_date,ds.start_time,mail_last_name
-----------------------------------
SCHEDULE_DATE  START_TIME  END_TIME NEW_NAME           POSITION  REASON_CODE
4/1/2012        5:45A         2:00P  Barbara A,Ardelean   SRPM      SH
4/1/2012        5:45A         2:00P  Nichole S,Baines     PHMB      SH
4/1/2012        5:45A         2:00P  Thomas A,Cutter      TLMB      SH
4/1/2012        5:45A         2:00P  Adrian A,Fis         TLMB      SH
4/1/2012        5:45A         2:00P  Mandy,Lemke          PHMB      SH
4/1/2012        5:45A         2:00P  Nancy M,Penna        PHMB      SH
4/1/2012        5:45A         2:00P  Nyisha D,Richardson  SRPM      SH
-----------------In the Beginning I want Day - Sunday and then schedule_date, start_time
April 2nd is a Monday and I want Monday and then schedule_date
0
Comment
Question by:anumoses
  • 2
  • 2
4 Comments
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 250 total points
ID: 37788360
Add it with to_char?

select to_char(ds.schedule_date,'Day'),ds.schedule_date,ds.start_hours||':'||ds.start_minutes
0
 
LVL 6

Author Comment

by:anumoses
ID: 37788374
I also want one more column end time minus start time as tot hrs (8.25)
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 37788388
>>I also want one more column end time minus start time

That wasn't part of this question.

Anyway: so add it.  Isn't that the output from your previous question?  Just incorporate that logic into this query.  It should just be another column.
0
 
LVL 6

Author Closing Comment

by:anumoses
ID: 37788433
thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now