Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/03/2004, 07:42
garridoman
 
Fecha de Ingreso: marzo-2002
Ubicación: la comuna de la florida santiago chile
Mensajes: 71
Antigüedad: 23 años
Puntos: 0
mayor tiempo time

Hola amigos tengo un problema

nesesito obtener el mayor tiempo de entrega de un producto
en este momento me saca el tiempo de cada producto que en esos casos es en minutos
pero ahora estoy complicado por que necesito comparar entre cada producto el tempo maximo de entrega

este es el codigo

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Option Explicit

dim sql, rs
%>
<!--#include file="../../Includes/Con_DB.asp" //-->
<%



Dim N_Parent, N_Direct
N_Parent="parent."
N_Direct="../../"
%>
<!--#include file="../../Includes/CNU.asp" //-->

<html>
<!-- Creation date: 05-03-2004 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="Manuel Garrido">
<meta name="generator" content="AceHTML 5 Pro">
<link href="../../Estilos/EstilosCSS.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" rightmargin="0" class="bodyImagecentro" bgcolor="#E6DCAB">
<br>
<table width="90%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#C58F59">

<tr >
<td colspan="7" align="center">Zona Roja Tiempo Cocina</td>
</tr>
<tr bgcolor="#C58F59">
<td>&nbsp;Codigo Producto</td>
<td>&nbsp;Hora Pedido</td>
<td>&nbsp;Hora Entrega</td>
<td>&nbsp;Nº de Pedidos</td>
<td>&nbsp;Mayor Tiempo</td>
</tr>
<%
dim HI,HT,cont,sqlcont,rscont,dife,horaP,minutoP,segun doP,horaE,minutoE,segundoE

sql="select * from atencion_pedidos where ped_estado = 2 order by ped_producto desc"

set Rs = objcon.execute(SQL)

if not rs.eof then
dim i,min,seg,var,aa,cero,min2
cero=0
do while not rs.eof

sqlcont="select count (*) from atencion_pedidos where ped_estado = 2 and ped_producto='"&rs("ped_producto")&"'"
rscont= objcon.execute(sqlcont)

horaP=datepart("h",rs("ped_horapedido"))
minutoP=datepart("n",rs("ped_horapedido"))
segundoP=datepart("s",rs("ped_horapedido"))

horaE=datepart("h",rs("ped_horaentrega"))
minutoE=datepart("n",rs("ped_horaentrega"))
segundoE=datepart("s",rs("ped_horaentrega"))

response.write("hora pedido : ")& horaP &" : " & minutoP &" : "& segundoP &" - - "
response.write("hora Entrega : ")& horaE &" : " & minutoE &" : "& segundoE

for i= 1 to rscont(0)

if horap = horae then
min =minutoe - minutop

end if

if horap < horae then
if minutop < minutoe then

min=minutoe - minutop
else
min = 60 - minutop + minutoe
end if
end if

next
response.write(" minutos ") &min&" -*- "



%>

<tr>
<td>&nbsp; <%=rs("ped_producto")%> </td>
<td>&nbsp; </td>
<td>&nbsp; </td>
<td>&nbsp; <%=rscont(0)%> </td>
<td>&nbsp; <%=min%></td>

</tr>
<%

rs.movenext
loop

else
response.write("<br>buenos ")
end if
%>
</table>

<br><br>
<div align="center">
<input type="button" class="boton" value="volver menu principal" onClick="VBScript:window.parent.document.location= '../Menu.asp'">
</div>

</body>
</html>