Today, a friend of the group browsing my asp98.cn website, she said it is best to do a list of the day's content, users are generally lazy to look down. Feel very reasonable, this is the so-called user experience, hehe! Say you're going to get it! So get to 1:30 P.M. ...--
The content list is very simple, here is not much to say, first idea, define a variable to get the value to query the database. If empty, it equals the current time.
The definition of a variable
The code is as follows: Dim variable name ' name yourself, I don't have a name. IF request.querystring ("parameter") = "" Then Variable name = Now () Else Variable name = request.querystring ("parameters") End If |
Second, to determine whether the date format is correct
I think it's important for him to be here when the program is done.
(Knowledge point: IsDate function)
The following is a reference fragment: If not IsDate (variable name) Then Variable name = Now () End If |
Third, database query
(Knowledge point: A datediff time function is used here)
The following is a reference fragment: SQL = "SELECT * from [table] where DATEDIFF (' d ', Database Time, '" & Variable Name & ') =0 ORDER by ID Desc " ............... ........... |
http:www.asp98.cn
Four, finally add a link
The following is a reference fragment: One day after the previous day |
One day later, you can add a judgment
<%if DateDiff ("D", variable name, now ()) >0 then%> display the link after day <%end
About this link, (*^__^*), I tried a lot of methods are not get the correct results, so the most stupid way, is to read out the month and a day, and then in the place of the day to add and subtract. Dear friends, if there is a better way, please contact me Oh! Please see the http://asp98.cn/Arclist.asp page of this site!