Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Datediff

Author  Topic 

jung1975
Aged Yak Warrior

503 Posts

Posted - 2004-09-28 : 14:23:10
Simple question with several solutions:

see if a person is over 40 or not if you have @DOB...



spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-09-28 : 14:40:16
maybe:

edit:
a little correction
if datediff(year, @dob, getdate()) > 40
begin
print 'over 40'
end
else
begin
print 'under 40'
end

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -