2
I’ve been having a hard time for some time. I’ve been researching, but I haven’t found anything that would help me.
I need to make a calculation in a query, is the following. I need to take the day the record was entered into the bank and then do an operation with the current date, I have to subtract the current date by the date that was entered into the bank, if the value of the subtraction is greater than 3 , I will know that this record is late. So I need to do this to register my table, and count how many are late. I know I should use COUNT(*)
, DATADIFF
, INTERVAL
, and so on, but I couldn’t. Is it possible ? How would it be ? Thank you.
What is the structure of your table?
– Allan Andrade
Basically, I have the code (int), Varchar client name, Data_operation (TIMESTAMP)
– Marlon Castro
You will use DATEDIFF to help solve the problem. I advise you to visit this site: https://www.w3schools.com/sql/func_mysql_datediff.asp Just follow the tutorial and you’ll be happy. I hope I’ve helped!
– user128880