Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare Birthdays with todays deade

Status
Not open for further replies.

gal4y

Technical User
Dec 24, 2001
72
0
0
US
I would like to compare an inputted Birthday (ShortDate) with today's date. Display in a query the birthdays within 7 days of today's date (before and after Date()).

Thank you for any assistance.

Greg
 
Here is one query that will do what you need. It returns today's birthdays plus 7 days before and after.

SELECT m.MemmberName, m.BirthDt, m.Tele FROM Members m
WHERE DateAdd("yyyy",DateDiff("yyyy",[m].[Birthdt],Date()),[m].[BirthDt])) Between Date()-7 And Date()+7)); If you want to get the best answer for your question read faq183-874.

Terry L. Broadbent - DBA
SQL Server Page:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top