I am trying to create a calender with people in a department, which must be printed monthly by the department head. The user must enter the month and department and calender must be generated and printed.
I want to know if this is possible with SQL.
I tried a few options, but cannot get the dates (from 1 to end of month) to be displayed as column aliases and employees as rows. My query looks like this:
--up to date 31
where dept_code = '&dept'
and (sysdate between to_date('&from_date','dd-mon-yyyy') and
group by emp_name
output looks something like this:
EMP_NAME DAY1 DAY2 DAY3
bonita graupe 2006/01/01 2006/01/02 2006/01/03
helena david 2006/01/01 2006/01/02 2006/01/03
hento truter 2006/01/01 2006/01/02 2006/01/03
valme kruger 2006/01/01 2006/01/02 2006/01/03
I want to date value to be the column alias for DAY1, DAY2 and DAY3 and where the current dates are, must be blanks.
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!