Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I m doing project on attendance management systm..the problem is that in this project..how i insert the arrival or departure time in same row in two different times..
what should be the query for this..??
Posted
Comments
Shubham Choudhary 28-Oct-13 6:17am    
hi!! by logic its not a good idea if u insert record in same row its not possible you want to update this row and when u update row so first inserted record in deleted
so you have to do insert detail by date and time and when you want to see report . customize report according to u

1 solution

I have found that a better way to handle this type of scenario is to have only a single record for in and and a single record for out. The table would be very simple: WHO, WHEN, WHAT.

WHAT is simply a way of marking punch-in and punch-out. You can use true/false, I/O, or whatever. This is because someone may forget to punch in or out, and thus, you can tell when you retreive the data. If you assume perfection, you could leave this out . . . but I wouldn't.

Retrieve Data: Now, all you need to do is get all data for a single WHO, in order of WHEN.


Why this way? Because you don't have to spend the time (mentally or computationally) deciding how to retreive an existing entry. Chronology takes care of that for you.
 
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