• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 416
  • Last Modified:

Mysql select every two months

Hi everybody.

I have an application that send emails to subscribers every week, every 14 days and every month, I select this information using an sql script every day.
Now i need to implement the two months subscription.
I like to make an sql select that retrieves this information and send the newsletter (for months with more than 28 days i'm sending the month email on 28th day)
Thanks for all your help.

Byron H.
  • 2
1 Solution
Ioannis AnifantakisSoftware EngineerCommented:
how about using modulo?


select ...........
from ..........
where ............
and day(current_date)=28
and month(current_date) % 2 = 0

That will return true for all even months
while the

and month(current_Date) % = 1
will return true for all odd months
Ioannis AnifantakisSoftware EngineerCommented:
Anyone there?
Waiting for responce
silencewAuthor Commented:
Sorry for the delay,
Thanks it works good :D
Byron H.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now