Sorry, a bit more info would be a good idea as this does not work doesnt really say much.
To start I am still using ADO 2.7 as not had time to fully learn ADO.NET yet, I also use the Microsoft Masked Edit Control to ask for the dates.
I have an access database with orders in it for this year, and I build the SQL statement my self.
The Code looks like this
sSQL = "SELECT * FROM POPHeader WHERE POPOrdDate >= " & me.mebStartDate.CtlText & " ORDER BY POPOrdNo"
this gives me
SELECT * FROM POPHeader WHERE POPOrdDate >= 31/01/2003 ORDER BY POPOrdNo
What I get returned are all the orders in the file, when I started to write this I was asking for a Start & End date that looked like this
sSQL = "SELECT * FROM POPHeader WHERE POPOrdDate >= " & me.mebStartDate.CtlText & " AND POPOrdDate <= " & me.mebEndDate.CtlText & " ORDER BY POPOrdNo"
This gives me
SELECT * FROM POPHeader WHERE POPOrdDate >= 01/01/2003 AND POPOrdate <= 31/01/2003 ORDER BY POPOrdNo
If I put single quotes in I get the following error
An unhandled exception of type System.Exception occurred in microsoft.visualbasic.dll
Additional information: Data type mismatch in criteria expression.
Any Help would be appreciated
Thanks