Select using between dates

Results 1 to 2 of 2

Thread: Select using between dates

  1. #1
    Join Date
    Dec 1969

    Default Select using between dates

    When I do the following it doesn;t want to know if the startdate is 01/01/00, why? It comes up with Division by zero (null) error.<BR><BR><BR>startdate="01/01/00"<BR>enddate="01/01/03"<BR>query="SELECT History_of_items.[Inv No], Count(History_of_items.[Inv No]) AS [CountOfInv No] FROM History_of_items WHERE History_of_items.[History Date Returned] BETWEEN " & datevalue(startdate) & " AND " & datevalue(enddate) & " GROUP BY History_of_items.[Inv No] ORDER BY Count(History_of_items.[Inv No]) DESC;"<BR>

  2. #2
    J. Paul Schmidt Guest

    Default RE: Select using between dates

    Perhaps try something like this using # before and after each date:<BR><BR>"BETWEEN #" & startdate & "# AND #" & enddate & "#...<BR><BR>Best regards,<BR>-Paul<BR><BR>J. Paul Schmidt, MBA<BR>Databases on the Web<BR><BR> <BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts