-1
I have a MYSQL bank and I need an SQL that refers to the PAYMENT DAY in the DAY field (this field will only have the DAY of the month that the client chose to make the payment, this field is of the INT type) and show me some record whenever less than 5 days to the payment day are missing. Of course this DIA field will be based on the current date.
I have this code:
Select * from conta where DAYOFMONTH(CURDATE()) - 5 = dia;
Only that does not work, because it shows only the records that are 5 days to maturity, ie if missing 4 days, 03 days, 02 days, 01 day it shows nothing. I need something that always shows some result when there are less than 5 days left to pay.
@Diegof I will remove the bold. truth. rss I edited my question, it has how to give me a help?
– Gladison Neuza Perosini
Possible duplicate of Query counting by date difference
– Bacco