For better performance you should make a few changes:
- add an index on DOB field
- rebuild the index and run TuneTable
- modify the query
select DOB from HSAA.Patient where dob<=dateadd('yy',-13,current_date) or dob between todate((year(current_date)-13)||'0101','yyyymmdd') and todate((year(current_date)-13)||'1231','yyyymmdd')
- Log in to post comments