I need to get the difference in days between the current date and the date stored in the database, subtract this difference by 90 and then check if the result is equal to 7. Where is the error?
whereRaw("90 - (DATEDIFF(now(), 'updated_at')) = 7")
I need to get the difference in days between the current date and the date stored in the database, subtract this difference by 90 and then check if the result is equal to 7. Where is the error?
whereRaw("90 - (DATEDIFF(now(), 'updated_at')) = 7")
It would not be like this, that is, the field updated_at
without quotes, because it is a field of your table:
whereRaw("(90 - (DATEDIFF(now(), updated_at))) = 7")