Oh yeah, one more thing... I think Oracle is now Ansi-92 compliant.
Try putting your join in the FROM Clause instead:
SELECT SUM(tbldetailentry.reghrs) AS Daystotals
FROM tblMainEntry INNER JOIN TblDetailEntry ON
tbldetailentry.MainID = tblMainEntry.MainID
WHERE tblDetailEntry.recorddate = to_date('#currentdate#','mm/dd/yyyy') AND
tblMainEntry.empid = #client.emplid# AND
Attendance_Code > 8000
-----Original Message-----
From: Angel Stewart [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 19, 2001 10:55 AM
To: CF-Talk
Subject: SQL To Sum data
--------------------------
SELECT SUM(tbldetailentry.reghrs) AS Daystotals
FROM tblMainEntry,TblDetailEntry
WHERE
tbldetailentry.MainID = tblMainEntry.MainID
AND
tblDetailEntry.recorddate =
to_date('#currentdate#','mm/dd/yyyy')
AND
tblMainEntry.empid = #client.emplid#
AND
Attendance_Code > 8000
---------------------
Can you folks find anything wrong with this code?
The idea is to simply add up all the Hours that a particular employee worked
on a day specified by Current Date,
where the Attendance code is greater than 8000 indicating a Vacation day.
It sounds just perfect in theory, but in practice it totally is not working.
It is missing out the first day, and it somehow gets ridiculous values for
the SUM.
I wonder if there is something fundamentally wrong with the SQL.
-Gel
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists