Hi. I am having problems doing a table join in the following scenario:
Table 1: Employee Info: EmployeeID, FirstName, Email
Table 2: Leave info submitted by employees: EmployeeID, FirstName,
LastName, DateEntered, LeaveType, LeaveStatus
Each record in Table 2 represents on day of leave. So if i am taking a
10 day vacation, there will be 10 records for that vacation in Table 2
for me.
I need to display a report that shows all leaves (vacation, sick days)
taken by all employees in current month. The display format needs to
be like this:
EmployeeName | Email | Leave summary for Current Month
Vacation | Sick
Tom [EMAIL PROTECTED] 5 6
John [EMAIL PROTECTED] 4 3
I know it needs a table join but it doesn't seem to work. The join is
showing the records that are common to both tables. It is excluding
the unique records. I am using this select statement:
SELECT EmpID, FirstName, LastName, Email, LeaveLogID, EmployeeID, Leavetype
FROM (SASCalendar INNER JOIN employee ON employee.EmpID =
SASCalendar.EmployeeID)
where ApproverID=10005 AND (YearMonth like '%12' and YearMonth like '2004%')
Please help urgently.
- Kenn
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188783
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54