Home Forums SQL Server 7,2000 T-SQL Not returning all rows using BETWEEN operator RE: Not returning all rows using BETWEEN operator

  • Its interesting.  I saw this exact same question just a day or so ago.  The reason is that your date column isn't a date column.  Its a datetime column. '05/07/2005' equates to '05/07/2005 12:00am'.  If you want to include everything from 5/7, you should add a day and use < @dteTo (if you continue to use 'between', you would need to add 11:59:59pm, which would leave the possibility of 11:59:59.001pm being excluded).

    Steve