Re: Re: SELECT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 17, 2011 at 12:58 PM, Jim Giner
<jim.giner@xxxxxxxxxxxxxxxxxx> wrote:
> I would do it this way:
>
> Where
>  $sel_d = (the day # you want)
>  $sel_m = (the month # you want)
>
> The "where" clause would be:
>
> Where  (start_month => $sel_m and start_day => $sel_d) and
>     (end_month =< $sel_m and end_day =< $sel_d)

Hmm, no this won't work. Check this:

start_month=10
start_day=15

end_month=1
end_day=1

sel_day=23
sel_month=12

in this case, sel_month IS greater than start_month and  sel_day IS
greater than start_day, HOWEVER sel_month is ALSO greater than
end_month and sel_day is ALSO greater than end_day in this case.

(wrap around to new year problem, wrap around to new month problem)

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux