Selecting BDay month to match Current month

10 pts.
Tags:
Crystal Reports
I am trying to pull a report selecting only records with a Birthday month matching the current month, regardless of year (i.e. all May birthdays). How do I do this?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

You say “SELECT” and so I assume you are using SQL.

Most flavors of SQL have a function to extract the month from a date. And also a special register for CURRENT DATE. Using this MONTH function makes your query very easy… something like this …

SELECT column1, column2, …, birthdate
FROM your_table
WHERE MONTH(birthdate) = MONTH(CURRENT DATE)
ORDER BY …

I hope this helps.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    More specific help could be provided if you confirm that you want to do this using SQL, and you specify the database you are connecting to.
    70,190 pointsBadges:
    report
  • CrystalHack
    How would you do this in crystal syntax? I'm grabbing a date with mm/dd/yyy time... Just really want to look at month and day, and use the next30days function to see what birthdays are coming up im the next 30 days.
    10 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following