<% sort = request("sort") ty = request("ty") tm = request("tm") if sort = "" then sort = 0 end if set rs = Server.CreateObject("ADODB.Recordset") if sort = 0 then Sql = "SELECT * FROM N_artcle WHERE (Artcle_version = 2) and (Assort_id > 24 and Assort_id < 37)" else Sql = "SELECT * FROM N_artcle WHERE (Artcle_version = 2) and Assort_id = '"&sort&"'" end if if ty <> "" then Sql = Sql & " and right(year(Artcle_date),2) = '"&right(ty,2)&"'" if tm <> "" then Sql = Sql & " and month(Artcle_date) = '"&tm&"'" end if end if Sql = Sql & " ORDER BY Artcle_date DESC" rs.Open Sql, conn,1,1 %>