When you do an attendance system, the number of days in which an employee is required to leave. The Leave Submission page provides the starting and ending dates for the leave, and it involves the possibility that the user will be able to take a few days of leave operation for a period of time. For example, from August 30 to September 3
Conceived the program structure, has not been used in the ASP in the date increment function, by querying the asp date increment keyword, found DateAdd ("D", 1, date) function, the problem is easy to solve many, the function of the above is very simple, the code is as follows:
First work out the days of absence: Dim daynum,dd Daynum = DateDiff ("D", start date, end date) |
The number of days after the leave, we directly judge, if it is a day, directly to the database to write the start date of the leave, if more than one day, then the loop to write data, as follows:
The following is a reference fragment: If Daynum = 0 Then Conn.execute ("INSERT INTO .... ... ..........") Else For DD = 0 to DD Conn.execute ("INSERT INTO .... ... ..........") Next End If |
OK, the problem is done, if there are related problems, welcome to join our website Arisisi www.alixixi.com bottom of the technical Group for communication.