en fette en haut de mon tableau j'ai 2 ligne nombres de commandes et combien sa fait sa marche ok mai je veut ajouté une ligne qui me dit le nombres de commande a trainter:
en fette pour sa je veut une formule qui compte le nombre le ligne dans la base de access vide dans un champs car quand on traite une commande on mai une date de traitement donc le champs n'est plus vide.
donc mon champs a compter a compter est "DateEnvoi_Com"
MERCI voila mon cote .....
<!-- #include file="./odbc.asp"-->
<%
Call CheckLoginInfo
'-- default SQL
if request.querystring("tri" ) = "mois" then
SQL = "SELECT * FROM commandes WHERE Date_Com > #" & year(now) & "/0" & month(now) & "/01#"
texte="Toutes les commandes du mois."
end if
if request.querystring("tri" ) <> "" then
if request.querystring("tri" ) = "Id_Com" then
texte="Toutes les commandes dans l'ordre des numero de commandes."
SQL = "SELECT * FROM commandes order by Id_Com"
end if
if request.querystring("tri" ) = "Date_Com" then
SQL = "SELECT * FROM commandes order by Date_Com"
texte="Toutes les commandes dans l'ordre chronologique."
end if
if request.querystring("tri" ) = "Total_Com" then
SQL = "SELECT * FROM commandes order by Total_Com"
texte="Toutes les commandes dans l'ordre croissant des totaux."
end if
else
if request.form("numero" ) <> "" then
SQL = "SELECT * FROM commandes WHERE id_Com="&request.form("numero" )
texte="Commande numero "&request.form("numero" )
End If
if request.form("client" ) <> "" then
SQL = "SELECT * FROM commandes WHERE id_client="&request.form("client" )
texte="Commandes passée pas le client numero "&request.form("client" )
End If
if request.querystring("client" ) <> "" then
SQL = "SELECT * FROM commandes WHERE id_client="&request.querystring("client" )
texte="Commandes passée pas le client numero "&request.form("client" )
End If
end if
on error resume next
cmdDC.CommandText = SQL
Set commande = Server.CreateObject("ADODB.Recordset" )
commande.Open cmdDC, , 0, 2
'-- Delete Link
If Request.QueryString("Action" ) = "Delete" Then
If Request.QueryString("ID" ) <> "" Then
RecordToDelete = CInt(Request.QueryString("ID" ))
If Not commande.BOF Then
commande.MoveFirst
Do Until commande.Fields("Id_com" ) = RecordToDelete
commande.MoveNext
Loop
commande.Delete
commande.Requery
End If
End If
End If
%>
<html>
<head>
<title>Les Commandes</title>
</head>
<body background="stucco.gif">
<p align="center"><font size="4"><strong><a href="addcommande.asp">Ajouter une commande</a>
/ <a href="commandes.asp">Retour</a> / <a href="index.asp">Gestion du shop</a></strong></font></p>
<p align="center"><%if commande.Fields("Id_Com" ) = "" then%></p>
<p align="center"> </p>
<p align="center"> </p>
<h2 align="center">Votre requête ne correspond à aucun enregistrement!<%else%></h2>
<h2 align="center"><%=texte%></h2>
<div align="center"><center>
<table border="1">
<tr>
<td>N° de commande</td>
<td>N° de client</td>
<td>Date commande</td>
<td>Date envoie</td>
<td>Total commande</td>
<td>Édition</td>
<td>Suppression</td>
</tr>
<%
SQL2="SELECT count(*) FROM commandes Where Date_Com > #" & year(now) & "/0" & month(now) & "/01#"
RS2 = conn.execute(SQL2)
Ntotal = RS2(0)
end if
SQL3="SELECT count(*) FROM commandes Where Date_Com > #" & year(now) & "/01#"
RS3 = conn.execute(SQL3)
Ntotal1 = RS3(0)
'-- Go to the first record
Total_mois = 0
If Not commande.BOF Then
commande.MoveFirst
Do Until commande.EOF
Response.Write(" <tr>" & Chr(13))
Response.Write(" <td bgcolor=" & chr(34) & "#C0C0C0" & chr(34) & ">" & commande.Fields("Id_Com" ) & "</td>" & Chr(13))
Response.Write(" <td bgcolor=" & chr(34) & "#C0C0C0" & chr(34) & "><a href='editclient_affiche.asp?ID=" & commande.Fields("Id_client" ) & "'</a>" & commande.Fields("Id_client" ) & "</td>" & Chr(13))
Response.Write(" <td bgcolor=" & chr(34) & "#C0C0C0" & chr(34) & ">" & commande.Fields("Date_Com" ) & "</td>" & Chr(13))
Response.Write(" <td bgcolor=" & chr(34) & "#E4E4E4" & chr(34) & ">" & commande.Fields("DateEnvoi_Com" ) & "</td>" & Chr(13))
Response.Write(" <td bgcolor=" & chr(34) & "#E4E4E4" & chr(34) & ">" & commande.Fields("Total_Com" ) & "</td>" & Chr(13))
if commande.Fields("DateEnvoi_Com" ) <> "" then
Response.Write(" <td bgcolor=" & chr(34) & "#E4E4E4" & chr(34) & "><center><a href='editcommande.asp?ID=" & commande.Fields("Id_com" ) & "'>Voir</a></td>" & Chr(13))
else
Response.Write(" <td bgcolor=" & chr(34) & "#E4E4E4" & chr(34) & "><center><a href='editcommande.asp?ID=" & commande.Fields("Id_com" ) & "'>Edit</a></td>" & Chr(13))
Response.Write(" <td bgcolor=" & chr(34) & "#E4E4E4" & chr(34) & "><center><a href='commandes.asp?Action=Delete&ID=" & commande.Fields("Id_com" ) & "'><img src=" & chr(34) & "../image/poub.gif" & chr(34) & " border=" & chr(34) & "0" & chr(34) & "></a></td></tr><tr>" & Chr(13))
end if
if request.querystring("tri" ) = "mois" then
Total_mois = Total_mois + formatnumber(commande.Fields("Total_Com" ),2)
end if
if request.querystring("tri" ) = "Date_Com" then
Total_mois = Total_mois + formatnumber(commande.Fields("Total_Com" ),2)
end if
commande.MoveNext
Loop
end if
if request.querystring("tri" ) = "mois" then
response.write ("<p>Total des commandes du mois = " & Total_mois & " €<br />" )
response.write ("Nombre de commande ce mois ci = " & Ntotal & "</p>" )
response.write ("Nombre de commande à traité = " & commande.Fields("DateEnvoi_Com" ) & "</p>" )
end if
if request.querystring("tri" ) = "Date_Com" then
response.write ("<p>Total des commandes = " & Total_mois & " €<br />" )
response.write ("Nombre de commande total = " & Ntotal1 & "</p>" )
end if
%>
</table>
</center></div>
<p align="center"></p>
<p align="center"> </p>
<h3 align="center"><a href="commandes.asp">Retour</a></h3>
</body>
</html>