Home > front end >  Check records found someone taped two times on the same day to work overtime, accounted for a big ch
Check records found someone taped two times on the same day to work overtime, accounted for a big ch

Time:10-24

This is to check the result: 12 Wang Yanhe recorded twice, too bad, take advantage of public


My data table:

such as the topic, how to limit her?

CodePudding user response:

Every day you to ASP home please write code

CodePudding user response:

 
Select * FROM jb where dat='" & amp; Dat & amp; "' and nam=" & amp; Nam & amp; "'

If the rs. EOF Then 'If the record does not exist the insert
Rs (" dat ")=dat
Rs (" nam ")=nam
.
The Else
. '
if records exist of actionEnd the If

CodePudding user response:

Above is correct

CodePudding user response:

Insert before judgment ever recorded

CodePudding user response:

refer to the second floor Derekwong response:
 
Select * FROM jb where dat='" & amp; Dat & amp; "' and nam=" & amp; Nam & amp; "'

If the rs. EOF Then 'If the record does not exist the insert
Rs (" dat ")=dat
Rs (" nam ")=nam
.
The Else
. '
if records exist of actionEnd the If

understand, thank you thank you!

CodePudding user response:

reference 5 floor HPFSSTTX reply:
Quote: refer to the second floor Derekwong response:

 
Select * FROM jb where dat='" & amp; Dat & amp; "' and nam=" & amp; Nam & amp; "'

If the rs. EOF Then 'If the record does not exist the insert
Rs (" dat ")=dat
Rs (" nam ")=nam
.
The Else
. '
if records exist of actionEnd the If

understand, thank you thank you!

No soft and concurrent conditions, do not execute judgment, the judgment is normally useful
Executed against the database pessimistic locking, the post is to join the temporary token validation can control this database to join

CodePudding user response:

I don't think you should make logo with name, after all, do not rule out a company has employees with the same,

CodePudding user response:

You to the top, and stick to the minute

CodePudding user response:

1. UniqueCode overtime table should be a new field, the employee number + DateTime value generate an employee in a day the only code
2. Add the only index to the field
In this way, can solve your problem, roughly the same employees, on the same day, can only add a data, other is invalid inserted, SQL will help you to get rid of,

CodePudding user response:

You should not be restricted she recorded twice, because the somebody else is different time periods, but this time some coincidence, either you program late processing data to heavy, calculate the full time, either at the time of entry process under article 2 of the data of starting time 15:00 modified to 20:00, and prompt the user for overlap is modified,

CodePudding user response:

This is actually the strategies:

1, at the time of entry, insert data, perform inspection,
2, if the same name, recorded and execute:
3, if the timing of the entry now, overlapping with previous time point, there is no entry, tip: time to repeat,
  •  Tags:  
  • ASP
  • Related