http://qs321.pair.com?node_id=11114431


in reply to Valid code?

As all the others said, it is syntactically correct, even if you check only the part that is between quotes.

That said, I am sad that nobody suggested basic arithmetic transformation from (reformatted for better clarity)
TO_DAYS(dateadded) - TO_DAYS(Now()) >= -$newdateadded
to
TO_DAYS(Now()) - TO_DAYS(dateadded) <= $newdateadded
of course, that is if the formula was right from the beginning. Otherwise the transformed one is as wrong as the original...