David,
Here is some ASP code I did that uses dates. But it does use Access, not SQL
Server. I hope it helps:
<%
' JBM: initialize start and end dates
attributes.Add "startdate", 0
attributes.Add "enddate", 0
if attributes.Exists("year") then
attributes.Item("startdate") = "1/1/" & attributes.Item("year")
attributes.Item("enddate") = "12/31/" & attributes.Item("year")
'JBM: make sure dates are in ODBC format
'attributes.Item("startdate") = "{d '" & attributes.Item("year") &
"-01-01'}"
'attributes.Item("enddate") = "{d '" & attributes.Item("year") &
"-12-31'}"
end if
Response.Flush
Dim rsYear, strSQL
strSQL = "SELECT * FROM tblLottoNumbers" & _
" WHERE DrawingDate BETWEEN #" &
attributes.Item("startdate") & "# AND #" & attributes.Item("enddate") & "#"
& _
" ORDER BY DrawingDate DESC"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DSN=MarshLottery"
Set rsYear = Server.CreateObject("ADODB.Recordset")
rsYear.Open strSQL, conn
%>
---
Jeffrey B. Marsh
Professionals built the Titanic.
Amateurs built the Ark.
-----Original Message-----
From: David Huyck [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 12:02 PM
To: Fusebox
Subject: Re: Date Type for SQL Server
<cf_sheepishly>
I'm working on an ASP project...
</cf_sheepishly>
David Huyck
[EMAIL PROTECTED]
****************************************************************************
This message is intended for the sole use of the individual and entity to
which it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law. If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message. If you have received this message in error, please immediately
advise the sender by reply email and delete the message. Thank you very
much.
****************************************************************************
****************************************************************************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists