I want to get data between a certain range of date from VB6 to Ms Access. Here is my code:
sqlh = "SELECT * FROM CustomerOrders WHERE OrderDate BETWEEN #" &
CDate(dtpFrom.V alue) & "# AND #" & CDate(dtpTo.Val ue) & "# ORDER BY OrderDate"
It works so strange. When I tried:
- only September, e.g. between 4 Sept - 26 Sept, it works perfect;y
- between September to October, it also works
- but it does not work for only October, e.g. 3 Oct - 29 Oct, it will shows all data in the database, not only Oct
Help me, please. It's for my assignment and due in two days.
Thank you so much.
sqlh = "SELECT * FROM CustomerOrders WHERE OrderDate BETWEEN #" &
CDate(dtpFrom.V alue) & "# AND #" & CDate(dtpTo.Val ue) & "# ORDER BY OrderDate"
It works so strange. When I tried:
- only September, e.g. between 4 Sept - 26 Sept, it works perfect;y
- between September to October, it also works
- but it does not work for only October, e.g. 3 Oct - 29 Oct, it will shows all data in the database, not only Oct
Help me, please. It's for my assignment and due in two days.
Thank you so much.