Original ASP gets all date values for two date periods

Source: Internet
Author: User

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.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.