Hi, was wondering if someone can help me, I trying to extract values from a database, but dates beween, 2 certain dates.
But, somehow, the values that's displayed, aren't the correct values.
I'm using access2003, with VB.NET. the data type af the 'adddate'-column are "date/time", and I'm using a DateTimePicker to alloy the user to select their own 2 dates.
this is the SELECT statement,
Dim
comm As New OleDb.OleDbCommand("SELECT * from labour where adddate between " & fromdate & " AND " & todate, conn)but easch time I try to run it, I get an error message, stating that "Missing operator
If someone can see something I'm not, please direct me.
Thanks
SJB

SELECT values between two selected DATES
CoderX
Hi!
You better use SQL parameters:
then you must add parameters @FromDate and @ToDate:
This is better because you don't need to care about dates to string formatting and parameters defend your code from SQL injection attacks.