BrockLesnar
01-29-2005, 07:18 PM
I'm running MS SQL 2000
I tried to do this
strSQL = "SELECT * from Stats where instr(lastvisit, @sDate) Order By LastVisit Desc"
Comm = new sqlCommand(strSQL, Conn)
Comm.Parameters.Add("@sDate", Calendar1.SelectedDate.ToShortDateString())
Conn.Open
Calanendar1 is a .Net Calendar control and the page is in VB.Net. The Lastvisit column in the sql database is datetime type.
But it gives the error
System.Data.SqlClient.SqlException: 'instr' is not a recognized function name.
How do I use the instr function inside the sql statement?
I tried to do this
strSQL = "SELECT * from Stats where instr(lastvisit, @sDate) Order By LastVisit Desc"
Comm = new sqlCommand(strSQL, Conn)
Comm.Parameters.Add("@sDate", Calendar1.SelectedDate.ToShortDateString())
Conn.Open
Calanendar1 is a .Net Calendar control and the page is in VB.Net. The Lastvisit column in the sql database is datetime type.
But it gives the error
System.Data.SqlClient.SqlException: 'instr' is not a recognized function name.
How do I use the instr function inside the sql statement?