set @ds:='2012-1-1';
select hn,birthday,timestampdiff(year,birthday,@ds) 'age_y'
,addrpart,lpad(moopart,2,'0') moopart,tmbpart,amppart,chwpart
from patient p
where timestampdiff(year,birthday,@ds) between 15 and 34
and chwpart=62
and amppart=10
and tmbpart=03
and moopart in (3,4,7,8)