Hi,
Please check the below query, and let me know if it helps.
SET @vQuery ='SELECT Child.gpmctc as gpmctc,Child.village as village ,Child.habitation as habitation,
Child.cname as cname, Child.sex as sex,Child.dob as dob,Child.sch_code as sch_code,Child.class as class,
Child.nereason as nereason,Child.droupout as droupout,Child.highclass as highclass
FROM ' + @ChildTblName + ' As Child
WHERE Child.distt = ' + @DistrictID + ' and LTRIM(RTRIM(ISNULL(sch_code,'''')))='''' and Child.block=' + @blockcode + ' and age>=6 and age<=14'
Thanks,
Hitesh Varde