Quote:adodc.RecordSource = "select * from EMPLOYEE where EMPLOYEE.DOB between dtpFromDate.value and dtpToDate.value"
you need to concantenate the date picker values into the SQL statement. right now it thinks that is just the name of a field not that it's a control and you want the value if it.
this is how it should be:
adodc.RecordSource = "select * from EMPLOYEE where EMPLOYEE.DOB between '" & dtpFromDate.value & "' and '" & dtpToDate.value & "'"
but one other thing. Are you using Access or SQL? if you're using access you'll need this one:
adodc.RecordSource = "select * from EMPLOYEE where EMPLOYEE.DOB between #" & dtpFromDate.value & "# and #" & dtpToDate.value & "#"
The # symbols on either side of the date tell Access that between them is a date value.
Enter your message below
Sign in or Join us (it's free).