select m.MemId,m.MemIn,m.memname,m.Gender,datediff("YYYY",m.MemAge,GETDATE())as Memage,m.MemTel,m.Addno,m.SubdistrictNo, ss.ssubdisname ,s.SubDisname,
m.district,m.Province,m.JoinDate,mt.MemTypeName,ms.MemStatusName,ml.MemLevelName,ic.IncomeStatusName
from member m, SubDistrict s, SubSubdistrict ss , MemType mt, MemStatus ms, MemLevel ml,IncomeStatus ic
where
m.Memname like '%ตัวอักษร%'
and s.SubDisId = 1
and ss.SsubDisId = 1
and mt.MemTypeId = 1
and ms.MemStatusId = 1
and ml.MemLevelId = 1
and ic.IncomeStatusId = 1
'ค่าพวกนี้คือ selectedvalue จาก combobox ของแต่ละตัว