Ole Db SQL Birthdays

BadgerByte

Well-known member
Joined
Aug 5, 2005
Messages
194
Location
Ipswich, UK
Programming Experience
5-10
Hi,

I haven't a great deal of experience with SQL other than your basic SELECT commands, and was hoping someone out there could save me a little time. I have a simple clients table with a dob field and simply wish to pull out all clients with birthdays in a specified date range.

I'm using Jet and am unsure of the necessary commands, have searched google and several forums but not found anything to help.

Any help would be greatly appreciated.
 
Hey Blokz,

Thank you for your answer, I'm using a datetime field to store dob which creates the issue. I can't use "between" straight like you've shown as the dob stores the Year as well as the Month and Day. Is there anyway of seperating the Month/Day from the datetime within the SQL statement in order to use similar logic?

Thanks again for your time.
 
It might depend on which database you are using but most SQL implemenations have MONTH and DAY functions. For info on how to use them if you aren't sure, I'd suggest looking them up on MSDN as T-SQL supports both.
 
Back
Top