Mike Martin wrote: > I am getting occasional incorrect results using between operator > > example > > table structure > recordings > ID > tsid > start > end > > sample time= 2010-03-16 23:06:00 > sample start= 2010-03-16-22:00:00 > sample end= 2010-03-16 23:05:00
Do you actually have a dash between date and time portion in your data (in your example, one appears in start but not in time or end)? If you have it inconsistently, that would throw off any comparisons. > select tsid from recordings where '2010-03-16 23:05:00' between start and end' You have an extra, mismatched single quote at the end. > This query should return nothing, so can anyone explain why it is > recording the tsid Why should this query return nothing? BETWEEN operator is inclusive. "x between a and b" is equivalent to "x>=a and x<=b". -- Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users