Quote:
Originally posted by mrdj1002
Hi guys
Well I’m developing an app which uses a db in which in table “A” I have field, “DATE” as Date/time field type. And some other fields which are string and long type. Now I want to do a SQL query on this table. And use the SQL statement in the following code to open the desired recordset:
SQLstatment= “SELECT A.DATE , A.Name ,A.UserID FROM A where A.DATE=’somedate’”
Set rs=db.Recordset(SQLstatment)
But vb returns error: Type mismatch.
I also tried the following method:
Dim datDate as date
datDate = now
SQLstatment= “SELECT A.DATE , A.Name ,A.UserID FROM A where A.DATE=” & datDate
But again another error. I don’t know how to make this query that the “WHERE” section asks about a “date type” field. Can anybody help?
are you using ADO? if so do you have a connection set up??? i am not so sure your sql statement is wrong as your method for opening it