CodeAve.com CodeAve.com - ASP - Database Table Display
ASP
·Read/Write
·Script Writers
·Database Display
·Response Objects
·Server Variables
·Random Events
·Articles
·Miscellaneous
·Contents
·What's New?
JavaScript
CSS
HTML
Maps
Links
Mail List
Search
Sitemap


 


Database Display by Date
Displaying a database by date values is just as easy as displaying any sub-set of your data.  When you're comparing numeric items in your sql against Access it is not necessary to delimit the value being passed (example: sql="select * from table where number = " &input value ).  Character items need to be delimited (example: sql="select * from table where text ='" &input value &"'" ).  Date values need a delimiter in order to differentiate it from anything else (example: sql="select * from table where date = #" & input value &"#" ).
View the Output
Text View
Print View
Mail this Link
Download the Code
View the Data

<%
u_date=request.form("u_date")
u_exp=request.form("u_exp")
' Check to see if the user inputted a value for u_date
' If it's null skip the query to the db and just show the imput form
if u_date<>"" then
accessdb="stocks" 
cn="DRIVER={Microsoft Access Driver (*.mdb)};"
cn=cn & "DBQ=" & server.mappath(accessdb)
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "select date,close,volume from epos where date "& u_exp& " #" & u_date & "# " 
rs.Open sql, cn
%>

<title>EPOS Daily Stock Info where the trading date is 
<%= server.htmlencode(u_exp) %>&nbsp;<%= u_date %> </title> 
<table border="0" align="center" width="100%">
<tr><td align="center">
EPOS Daily Stock Info where<br> the trading date is 
<%= server.htmlencode(u_exp) %>&nbsp;<%= u_date %> <br> 
<table border="5" cellpadding="3" cellspacing="3" align="center">
<tr><td>
Date
</td> 
<td>
Close
</td> 
<td>
Volume
</td> 
</tr>
<%
rs.movefirst
do while not rs.eof
%>

<tr><td>
<%= rs("date") %>
</td>
<td>
<%= "$ "& formatnumber(rs("close"),2,0) %>
</td>
<td>
<%= formatnumber(rs("volume"),0) %>
</td>
</tr>
<%
rs.movenext
loop
%>

</table>
<% 
end if
%>
<form action="<%= request.servervariables("script_name") %>"
method="post">
<%
if u_date = "" then %>

Please make a selection<br>
<% end if %>
<select name="u_exp" size="1">
<% 
' Check to see if there is a value for u_exp
' If there is then write it as the selected value
' in the dropdown menu
if u_exp <> "" then %>

<option selected value="<%= u_exp %>"><%= server.htmlencode(u_exp) %></option>
<% end if %>
<option value="=">=</option>
<option value=">">&gt;</option>
<option value="<">&lt;</option>
<option value=">=">&gt;=</option>
<option value="<=">&lt;=</option>
<option value="<>">&lt;&gt;</option>
</select>
&nbsp;
<select name="u_date" size="1">
<% 
' Check to see if there is a value for u_date
' If there is then write it as the selected value
' in the dropdown menu
if u_date <> "" then %>

<option selected value="<%= u_date %>"><%= u_date %></option>
<% end if %>
<option value="10/19/1999">10/19/1999</option>
<option value="10/26/1999">10/26/1999</option>
<option value="11/03/1999">11/03/1999</option>
<option value="11/10/1999">11/10/1999</option>
<option value="11/17/1999">11/17/1999</option>
<option value="11/24/1999">11/24/1999</option>
<option value="12/01/1999">12/01/1999</option>
<option value="12/08/1999">12/08/1999</option>
<option value="12/15/1999">12/15/1999</option>
<option value="12/22/1999">11/22/1999</option>
<option value="12/29/1999">11/29/1999</option>
<option value="01/05/2000">01/05/2000</option>
<option value="01/12/2000">01/12/2000</option>
<option value="01/19/2000">01/19/2000</option>
</select>
<input type="submit" value="Submit">
</form>
</td></tr></table>

 

 

 



ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement

    CodeAve.com is hosted by MyHosting.com
    Donate Food Online with a Mouse Click at TheHungerSite.com
    Donate Land Online with a Mouse Click at TheRainForestSite.com
    © 1999 - 2017 CodeAve.com
    All Rights Reserved

  • Kids jordan 6 rings
  • Jordan retro 10
  • Jordan retro 3