Link to home
Start Free TrialLog in
Avatar of myyis
myyis

asked on

find if today is a recurring day

Hi:

Let's say on 10/10/2014 I have created a recurring task. It recurs on every 10 days.
How can I understand if today there is a recurring task?

Thank you.
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

step 1: number of days between schedule start and today, using datediff
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_datediff

step 2: use the modulo function to see if the remainder of the division (datediff ...) and the (10 days) divisor gives 0 or not:
http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_mod
Avatar of myyis
myyis

ASKER

I see that it will be difficult for me to go over the steps. You make me super happy if you write the  query,
thank you very much.
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of myyis

ASKER

thank you