You can use the CASE and DATEDIFF functions in T-SQL.
Select
col1, col2, col3,
col4 =
Case
When datediff(d,birthdate,getdate())/365.25
Between 19 And 24 Then 'yes'
Else 'no'
End
From table_name Terry L. Broadbent - DBA
Computing Links:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.