[thelist] SQL: Birthday report

Seth Bienek evolt.list at sethbienek.com
Fri Oct 18 09:03:02 CDT 2002

I'm given a task of writing a report to display clients whose birthday
is within a provided date range.  Sounds simple, right?  It ain't.

I found a very good article on doing this in MySQL by evolt's very own
Rudy Limeback:

The major problem with this approach being that I am using SQL Server
and the constructs he provides don't work with SQL server, specifically
this statement:

           < RIGHT(birthdate,5)

Can someone (rudy maybe? :) explain what this does?  I am assuming it
tells the DB to choose the greater of the two, but that's a guess, so I
could be completely off-track.  Also, how can this be reconstructed for
SQL Server?

I am convinced that Rudy's approach is the most effective for getting
this done, if I can just get my hands around it; of course, I am open to
other approaches as well..

Any help is greatly appreciated!



More information about the thelist mailing list