Query

Submitted by Xes_ on

Hi.

Please check. The scenario is like this, I want to print data using from - to Date . Which means 2 dtpicker.  I'really don't know what went wrong, is it my query or how i execute the my report.this is my code.

 if rs.state = adstateopen then rs.close

   rs.open = "Select * from Schedule where Date >= #"& Dtpicker1.value &"# and Date <= _

   #"& Dtpicker2.value &"# order by Date",cn,2,3

        if rs.recordcount > 0 then

                        rptServiced.show vbmodal

                 else

                       msgbox"No Record Found!",vbOKonly + vbExclamation, "No Record"

                       exit sub

        end if

  There is no error on my code. but theres something wrong when i filter the dates,  like for example i have   a 2 records on

   the database which is dated 11/19/2010 and 11/25/2010. when i search using dtpicker1 = 11/18/2010

   and dtpicker2 = 11/20/2010. So the reprot should show the record which is dated 11/20/2010 but is now is shows all the records instead. Any help pls? T_T