05年9月14日 代码片断(日期比较)
<%
'筛选符合交友要求的用户并且返回一个数组
Dim I_Choice,YearFrom,YearTo
SQL = "Select Sex,AgeFrom,AgeTo,HeightFrom,HeightTo,Married,Nation,Education,Up,Province,City,Photo,ac_Vip,LastDate From [pH_Ideal_Friends] Where User_name='"&User_name&"'"
Set Rs = Conn.Execute(SQL)
If Rs.Eof Then
Response.write "没有找到指定的用户!"
Response.End()
End if
I_Choice = Rs.GetRows()
Rs.Close
'判断年龄
if I_Choice(1,0) = "" or I_Choice(2,0) = "" then
response.write "年龄判断出错,请于管理员联系!"
else
YearTo = Year(now) - I_Choice(1,0)
YearFrom = Year(now) - I_Choice(2,0)
end if
SQL = "Select nickname,Vip_Star,Photo_url From [pH_UserInfo] where "
SQL = SQL & "Sex = '"& I_Choice(0,0) &"' And "
SQL = SQL & "Byear > "& YearFrom &" And Byear < "& YearTo &" And "
if I_Choice(5,0) <> "0" then
SQL = SQL & " married = '"& I_Choice(5,0) &"' And "
End if
if I_Choice(6,0) <> "0" then
SQL = SQL & " nation = '"& I_Choice(6,0) &"' And "
End if
if I_Choice(7,0) > 0 then
if I_Choice(8,0) = "True" then
SQL = SQL & " education > "& I_Choice(7,0) &" And "
Else
SQL = SQL & " education = "& I_Choice(7,0) &" And "
End if
End if
if I_Choice(9,0) <> "0" then
SQL = SQL & " province = '"& I_Choice(9,0) &"' And "
End if
if I_Choice(10,0) <> "" then
SQL = SQL & " city = '"& I_Choice(10,0) &"' And "
End if
if I_Choice(11,0) <> 0 then
SQL = SQL & " photo_url <> '' And "
End if
if I_Choice(12,0) > "0" then
SQL = SQL & " Vip_Star <= '"& I_Choice(12,0) &"' And "
End if
if I_Choice(13,0) > 0 then
SQl = SQL & " datediff('d',last_time,now()) < "&I_Choice(13,0)&" and "
End if SQL = SQL & "height > "& I_Choice(3,0) &" And height < "& I_Choice(4,0) &" Order By user_id DESC"
Set Rs = Conn.Execute(SQL)
If Rs.Eof Then
Dim NoFriendMsg
NoFriendMsg = "暂时没有适合您的好友,请重新设定您的争友条件。"
End if
I_Choice = Rs.GetRows()
Rs.Close
SQL = "Select Vip_Star,SmsGetBoxSize From [SystemSite] Where ID="&I_Choice(1,0)&""
Set Rs = Conn.Execute(SQL)
If Rs.eof Then
Response.write "调用等级出错,请联系管理员!"
Response.End()
End if
I_Choice_Vip = Rs.GetRows()
Rs.Close
%>
浙公网安备 33010602011771号