Keep It Simple, Stupid | |
PerlMonks |
Re: Valid code?by Marshall (Canon) |
on Mar 19, 2020 at 01:27 UTC ( [id://11114449]=note: print w/replies, xml ) | Need Help?? |
$no_days = "(TO_DAYS(dateadded)-TO_DAYS(Now())>=-$newdateadded)";Without running any code, it appears to me that you have a "units" problem. dateadded and Now are transformed by the TO_DAYS function but their difference is being compared to $newdateadded. Why doesn't TO_DAYS() apply to all 3 terms? Aside from that, this is string, why not: $no_days = TO_DAYS($dateadded)-TO_DAYS(Now()) >= TO_DAYS($newdateadded); Put your code in a program and run it!
In Section
Seekers of Perl Wisdom
|
|