select siteid,tattachmentid, mpctaskid
from tattachment
where --convert(varchar(10), createdate, 120) >= convert(varchar(10), DATEADD(DD, -1, GETDATE()), 120)and
      isnull(mpctaskid, '') != '' and isnull(serialnumber_hls, '') = ''