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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning records based on dob field 1

Status
Not open for further replies.

JSMITH242B

Programmer
Joined
Mar 7, 2003
Messages
352
Location
GB
Hi Group,

I need to return records where the age of a person is less than 11.
I have a dob field in my table which I can use with the Now function to return the desired results but I have a problem with defining the SQL statement using this.

Any help much appreciated.
 
Something like this might do

Code:
select * from mytable
where datediff(yy, DOB, getdate()) < 11


"I'm living so far beyond my income that we may almost be said to be living apart
 
Thanks hmckillop.
This did the trick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top