Código:
<% LANGUAGE = VBScript %> <HTML> <HEAD> <TITLE>Fechas2.asp</TITLE> </HEAD> <BODY bgcolor=99CCFF> <IMG src="image002.jpg"> <% Dim COMPLETION_SUBINVENTORY, WIP_ENTITY_NAME, SEGMENT1 Dim DESCRIPTION, SCHEDULED_START_DATE, START_QUANTITY Dim QUANTITY_COMPLETED, MEANING, DATE_RELEASED Dim SCHEDULED_COMPLETION_DATE, DATE_COMPLETED, DATE_CLOSED Dim fechaini Dim fechafin Dim sSQL, Recordset, Conn 'Recogemos los valores del formulario fechaini= Request.Form("fechaini") fechafin= Request.Form("fechafin") 'Instanciamos y abrimos nuestro objeto conexion Set Conn = Server.CreateObject("ADODB.Connection") 'Set Conn = Server.CreateObject("ADODB.Recordset") Conn.Open "Donaldson" 'Ahora creamos la sentencia SQL sSQL="Select * From P1_ORDENES_COMPLETADAS WHERE DATE_COMPLETED between "& fechaini &" and "& fechafin &"" 'SELECT campon FROM tabla WHERE fechaini > fechaini AND fechafin< fechafin" response.Write(sSQL) 'Set RS = Server.CreateObject("ADODB.Connection") 'Recordset.Open Conn, sSQL 'Ejecutamos la orden set Recordset = Conn.Execute(sSQL) 'Mostramos los registros %> <table align="center" border=1> <th>Subinventario</th> <th>Numero de orden</th> <th>Numero de parte</th> <th>Descripcion</th> <th>Fecha programada de inicio</th> <th>Cantidad programada de piezas</th> <th>Cantidad de piezas comletadas</th> <th>Cantidad de piezas de Scrap</th> <th>Status de la orden</th> <th>Fecha de liberacion de la orden</th> <th>Fecha programada para completar</th> <th>Fecha en que se completo</th> <th>Fecha en que se cerro</th> </tr> <% Do While Not Recordset.EoF %> <tr> <td><%=RS("COMPLETION_SUBINVENTORY")%></td> <td><%=RS("WIP_ENTITY_NAME")%></td> <td><%=RS("SEGMENT1")%></td> <td><%=RS("DESCRIPTION")%></td> <td><%=RS("SCHEDULED_START_DATE")%></td> <td><%=RS("START_QUANTITY")%></td> <td><%=RS("QUANTITY_COMPLETED")%></td> <td><%=RS("QUANTITY_SCRAPPED")%></td> <td><%=RS("MEANING")%></td> <td><%=RS("DATE_RELEASED")%></td> <td><%=RS("SCHEDULED_COMPLETION_DATE")%></td> <td><%=RS("DATE_COMPLETED")%></td> <td><%=RS("DATE_CLOSED")%></td> </tr> <% RS.MoveNext Loop 'Cerramos el sistema de conexion Conn.Close %> </table> <br><br> <div align="center"><a href="Grafica.asp">Ver grafica</a></div> </BODY> </HTML> :)