Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/12/2005, 10:26
Avatar de ivan floyd
ivan floyd
 
Fecha de Ingreso: diciembre-2005
Mensajes: 13
Antigüedad: 19 años, 4 meses
Puntos: 0
busqueda entre dos fechas

Hola amigos primero que todo muy feliza navidad
bueno mi duda es la siguiente ojala me puedan ayudar:
no me resulta buscar entre dos fechas en la base de datos aca esta el codigo, si alguien me puede ayudar de antemano gracias
no se cual sera el error, quiza es mas facil de lo que parece.
(el formulario)
<form name="form1" method="post" action="Consulta_entre_fecha2.asp">
<table width="200" border="1" bordercolor="#33CCFF" bgcolor="#000000">
<tr>
<td bgcolor="#66CCFF"><strong>FECHA:</strong></td>
<td bgcolor="#33CCFF"><input name="fecha" type="text1" id="fecha"></td>
<td bgcolor="#33CCFF"><input name="fecha" type="text2" id="fecha"></td>

<td bgcolor="#33CCFF"><input type="submit" name="Submit" value="Buscar"></td>
<td bgcolor="#33CCFF"><input type="reset" name="Submit" value="Restablecer">
</td>
</tr>
</table>

</form>
(el proceso)
<%fecha=request.Form("fecha")

Dim conexion, registros, basedatos, consulta

basedatos = Server.MapPath("./reservas.mdb")

Set conexion = Server.CreateObject("ADODB.Connection")

conexion.Open("Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & basedatos)

consulta = "SELECT * FROM auditorio where [auditorio.fecha] between '"&text1&"' and '"&text2&"'"
Set registros = conexion.Execute(consulta)
%>

<%if registros.EOF then%>
<h3 align="center">
<font color="#FF0000">No hay datos que coincidan con su petición </font></h3>
<p align="center"><a href="Consulta_entre_fecha1.asp">Intente de nuevo</a></p>
<%else%><br><br>

<div id="Layer1" style="position:absolute; left:124px; top:27px; width:753px; height:185px; z-index:1">
<table width="751" border="0">
<tr>

<th width="103" bgcolor="#66CCFF">Fecha
<th width="146" bgcolor="#66CCFF">Modulo
<th width="115" bgcolor="#66CCFF">Solicitante
<th width="162" bgcolor="#66CCFF">Comentarios </tr>
<%
Do while not registros.eof
%>
<tr>
<td align="center"><%=registros.Fields("fecha")%></td><br>
<td align="center"><%=registros.Fields("modulo")%></td>
<td align="center"><%=registros.Fields("solicitante")% ></td>
<td align="center"><%=registros.Fields("comentarios")% ></td>
</tr>

<%

registros.MoveNext

loop
registros.close
End if%>
</table>
<p align="center"><a href="Consulta_entre_fecha1.asp">Atras</a></p>
</div>