<%
poste = Replace(Request("lstcrt"), "'", "''")
dat30=day(date-30)&"/"&month(date-30)&"/"&year(date-30)
dat365=day(date)-1&"/"&month(date)&"/"&year(date)
response.write poste&"<hr>"
sql="select * from INSCRIPTION"
select case poste
case "Derniers 30 jours"
response.write "Passé dans Derniers 30 jours<hr>"
sql = sql & " where DateInscription <=#"&dat30&"#"
case " derniere annee"
response.write "Passé dans Derniere annee<hr>"
sql = sql & " where DateInscription <=#"&dat365&"#"
end select
Set Connection = CreateObject("ADODB.Connection")
Connection.Open "Driver={SQL Server};" & _
"Server=CDM815SRV02;" & _
"Database=stage;" & _
"Uid=stage;" & _
"Pwd=stage"
Set RS = CreateObject("ADODB.Recordset")
response.write sql&"<hr>"
RS.Open sql, Connection, 3,3
if RS.RecordCount = 0 then
Response.Redirect "erreur1.html"
end if
%>
Partager