Advertisement
Willcode4cash

Calculate age

Aug 14th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.10 KB | None | 0 0
  1. DateTime now = DateTime.Today;
  2. int age = now.Year - bday.Year;
  3. if (bday > now.AddYears(-age)) age--;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement