Hi There,
I have been struggling to make this bit of code work...is there something wrong in it?:
rst.Open ("Select * from tblusers where (tblusers.fromdate <= #" & Date & "#) AND (tblusers.toddate >= #" & Date & "#)")
I want to be able to select records which have from date < current date and to date greater than current date.
The table is located on SQL server and linked to Access front end and the From date and To date fields are datetime fields.
Is there anything wrong with this code?
The whole thing works fine on a query but it is the code that is causing a problem.
Could you please throw some light?
Thanks,
Priya
I have been struggling to make this bit of code work...is there something wrong in it?:
rst.Open ("Select * from tblusers where (tblusers.fromdate <= #" & Date & "#) AND (tblusers.toddate >= #" & Date & "#)")
I want to be able to select records which have from date < current date and to date greater than current date.
The table is located on SQL server and linked to Access front end and the From date and To date fields are datetime fields.
Is there anything wrong with this code?
The whole thing works fine on a query but it is the code that is causing a problem.
Could you please throw some light?
Thanks,
Priya