>Hi Nadya,
>
>you uses DATE() function on WHERE clause ?
>
>Fabio
No, I meant, that date comparision part could be moved into where clause from JOIN (you did join on PK and dates range, I would move that part in WHERE). I agree, that it's better to not use functions in SQL, if they could be replaced with variables. So, your comment about using dEnd instead of date() is valid. I'm not sure, how would it affect on performance, probably unnoticable anyway... But it's a good practice in my opinion.
If it's not broken, fix it until it is.
My Blog