Careful when using between in SQL

When you tried to execute SQL query used between date or ?<=data>=? as argument, sometimes the results were different from we were looking for. Why?

When u created or inserted new data to table using generated date, sometimes it provided u with hours,minutes,second,and millisecond which were not 0 (zero), it gave u unaware result. When u did query with between date (begin n end date), the end date would set hours,minutes,second,and millisecond to 0(zero), so data with the end date would not appear.

Solution:
Before you insert or create new data to table make sure to reset (make it zero) hours,minutes,second,and millisecond.

Good luck and happy coding.
wass wr wb,
SAdr LM

Leave a Reply