> Hi
>
> In mysql I found a problem with between query.
>
> For example
> select * from bugdetail  where
> dbugcreate_date between from_days(to_days('2002-03-01')) and
> from_days(to_days('2002-03-04'))
>
> this query shows only those records up to '2002-03-03'  instead of
> '2002-03-04'

Are all that date calculations necessary?

SELECT * FROM bugdetail WHERE dbugcreate_date BETWEEN '2002-03-01' AND
'2002-03-04'

Would work just as well =)

Also from what you're saying everything seems correct....don't forget the
dates without a time are considered to be at the beginning of that day

So technically you're asking

SELECT * FROM bugdetail WHERE dbugcreate_date BETWEEN '2002-03-01 00:00:00'
AND '2002-03-04 00:00:00'

which will only show result from beginning of march first to the end of
march 3rd.  You need to increment the final date by a day to get the fully
results you're seeking.

Sincerely,

Craig Vincent


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to