longmatch
Programmer
- Nov 1, 2001
- 406
I met a problem to use date format data in the user text input box. How can I refer the value in the textbox in my query. The value from the text input box should be a pure text. Do I need to convert into date format using cDATE? How to refer in the query.
<%
dim strQuery
dim objrs
dim startdate
startdate = CDate(Request.Form ("startdate"
)
if Request.Form("startDate"
<>"" then
strQuery = "select * from FORM_ID_198163500 where DateOfProc = startdate"
set objrs = server.CreateObject("ADODB.recordset"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
objrs.Open strQuery, objconn, adOpenForwardOnly, adLockReadOnly, adocmdText
Response.Write recTotable(objrs)
end if
%>
this code works fine without where sentence.
Big thanks
Haijun
<%
dim strQuery
dim objrs
dim startdate
startdate = CDate(Request.Form ("startdate"
if Request.Form("startDate"
strQuery = "select * from FORM_ID_198163500 where DateOfProc = startdate"
set objrs = server.CreateObject("ADODB.recordset"
objrs.Open strQuery, objconn, adOpenForwardOnly, adLockReadOnly, adocmdText
Response.Write recTotable(objrs)
end if
%>
this code works fine without where sentence.
Big thanks
Haijun