SQL MAIN= SELECT distinct(ref_product.id),ref_product.catalogpartcode,date(lastedited) as 'ledate',imageurl,entrytype,upc FROM ref_product WHERE ref_product.EntryType IN('basepart','bundle','kit') AND ref_product.active='1' AND ref_product.manufacturerid IN(select id from lslocal.site_manufacturers where active='1') and catalogpartcode >= '700wswin1tkz-led824-277' and catalogpartcode <= '700wswin2mwz-led835' order by ref_product.catalogpartcode,ref_product.id ;