Click here to Skip to main content
15,945,119 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
Currently, I have a code that retrieves an employee's ID,firstName,lastName and position.
These pieces of Information are then inserted to a jtable with checkboxes.
Then check if the employee is present or not.
Then there is a save button that when clicked, the attedance is saved into a new table in the database which has the fields empID,dateAttended,Present (boolean).

Now, what I want to do is to have a monthly attendance sheet, which compiles all the daily attendances.
Can anyone please help me on how i can achieve this? big thanks.
Updated 4-May-14 23:37pm
wikus70 5-May-14 2:30am    
You'll have to write a query that will loop through the table looking for the employee you want to pull the report for. From there you'll be able to see what days the employee was at work.
wikus70 6-May-14 10:03am    
Can you post your connection code. I'll see what I can do for you.
Also, do you want a total of the number of days the user attended or a total number of hours?

1 solution

That is a classic homework task - please provide code.

I'd go with the comment of wilkus70. you're saving the attendance each time with a save-button to the DB.
So you should make an request to receive all entries which have the empID you are requesting it for.

so that would be

SELECT * FROM [tablename] WHERE empID IS LIKE '[empID]'

(please notice the ' to mask the value)
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900