|
 |
asp_web_howto thread: Does Select have a todats date fuction or do you have to change it daily
Message #1 by lodris@m... on Thu, 17 May 2001 13:57:15
|
|
I want to just return the rows that were inserted into the database
today .I was wodering is there a way to do this without changing the date
daily.
Heres the code where the dat would go in
Set oRs = oConn.Execute("SELECT * From stocks WHERE Trade_date= ????")
Trade date is in the format of 17-MAY-01 and im using sql server 7.0
Thanks Leigh
<%
Dim oConn
Dim oRs
Dim filePath
Dim Index
'dim conn, strSQL, strSQL1, rst
set oconn = Server.CreateObject("ADODB.Connection")
oconn.Open "DSN=project; uid=lodris-ca4; pwd=lodris1141;"
set oRs = Server.CreateObject("ADODB.Recordset")
Set oRs = oConn.Execute("SELECT * From stocks")
%>
<%
Do while (Not oRs.eof) %>
<tr>
<% For Index=0 to (oRs.fields.count-1) %>
<TD VAlign=top><% = oRs(Index)%></TD>
<% Next %>
</tr>
<% oRs.MoveNext
Loop
%>
Message #2 by bnrao@h... on Thu, 17 May 2001 15:43:35
|
|
Why don't you use the GetDate() function which will return the today's
date and format using convert function. Hope it helps.
> I want to just return the rows that were inserted into the database
> today .I was wodering is there a way to do this without changing the
date
> daily.
> Heres the code where the dat would go in
> Set oRs = oConn.Execute("SELECT * From stocks WHERE Trade_date= ????")
> Trade date is in the format of 17-MAY-01 and im using sql server 7.0
> Thanks Leigh
> <%
> Dim oConn
> Dim oRs
> Dim filePath
> Dim Index
> 'dim conn, strSQL, strSQL1, rst
> set oconn = Server.CreateObject("ADODB.Connection")
> oconn.Open "DSN=project; uid=lodris-ca4; pwd=lodris1141;"
> set oRs = Server.CreateObject("ADODB.Recordset")
>
>
>
>
> Set oRs = oConn.Execute("SELECT * From stocks")
> %>
> <%
> Do while (Not oRs.eof) %>
>
> <tr>
> <% For Index=0 to (oRs.fields.count-1) %>
> <TD VAlign=top><% = oRs(Index)%></TD>
> <% Next %>
> </tr>
>
> <% oRs.MoveNext
> Loop
> %>
>
|
|
 |