![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Can anyone help I am trying to perform a select query from within VB connecting to a SQL Server 2000 database. I am trying to select and in the where clause i want to search for a date. The field 'MyField' in the database is set up as a datetime data type. See code below. --- dim rs as recordset dim con dim sqstring con.Open = "Provider=SQLOLEDB.1;Data Source=(local);Initial Catalog=MyDatabase;user id = 'sa';password='sa'" sqlstring = "Select MyField from MyTable where MyField = '01/01/2004' " rs.Open sqlstring, con, 1 ---- I have also tried various other variations on how to represent the date Nothing is coming back and there definately is data for the date. What is the syntax for searcing for datetime data types through ADO? |
#3
| |||
| |||
|
|
Can anyone help I am trying to perform a select query from within VB connecting to a SQL Server 2000 database. I am trying to select and in the where clause i want to search for a date. The field 'MyField' in the database is set up as a datetime data type. See code below. --- dim rs as recordset dim con dim sqstring con.Open = "Provider=SQLOLEDB.1;Data Source=(local);Initial Catalog=MyDatabase;user id = 'sa';password='sa'" sqlstring = "Select MyField from MyTable where MyField = '01/01/2004' " rs.Open sqlstring, con, 1 ---- I have also tried various other variations on how to represent the date Nothing is coming back and there definately is data for the date. What is the syntax for searcing for datetime data types through ADO? |
![]() |
| Thread Tools | |
| Display Modes | |
| |