Hi everyone.
I am trying to write a macro in vb6 where I find records between 2 specific dates. The database I am using is SQL server 2005. The field that will contain the dates uses a datetime data type. In Access this would be easy. Unfortunately, with SQL I cannot do it.
My code looks like:
recordset.open "Select * from [table searched] WHERE [specificdatefield] BETWEEN #" & format(startdate,"MM/dd/yyyy) & "# AND #" & format(startdate,"MM/dd/yyyy) & "#".
This would work with an Access database.
Any help would be greatly appreciated.
Tim Christopher
I am trying to write a macro in vb6 where I find records between 2 specific dates. The database I am using is SQL server 2005. The field that will contain the dates uses a datetime data type. In Access this would be easy. Unfortunately, with SQL I cannot do it.
My code looks like:
recordset.open "Select * from [table searched] WHERE [specificdatefield] BETWEEN #" & format(startdate,"MM/dd/yyyy) & "# AND #" & format(startdate,"MM/dd/yyyy) & "#".
This would work with an Access database.
Any help would be greatly appreciated.
Tim Christopher