Clear database column from time to time [closed]

-5

Is it possible to clear the database column at the end of the day / week / month? I have a code that records the number of calls an employee makes. For example: at the end of the day he performed 17 calls, so the next day the value should return to zero. However, the value of the week can not be zero because it made 17 calls the day before. And that should happen for the month too. Thank you in advance!

    
asked by anonymous 30.08.2017 / 20:43

1 answer

1

If you already register this data, why delete it? You can do this using trigger (need to detail which bank you are using). But it is a waste of server processing.

If it is just by displaying the data to the user, you can easily solve this in two steps:

1) Change the table to save the current date when saving is done

2) Perform a query in the DB using where (and filter by day, week and month parameters, as the case may be).

    
30.08.2017 / 20:52