If ShareCode.LowMemoryDevice Then
ImageLimit = $"and length(imageb64) < 170000"$
End If
Dim sSQL As String = $"select distinct a.id, ifnull(a.image,'') as imageb64, ifnull(a.filename,'') as imagename, 0 as base_image, 0 as on_report
from dta_tasks_items as a
inner join dta_requests_values as b on (b.task_tagcode=b.task_tagcode
and b.item_tagcode=a.item_tagcode and b.unique_key=a.unique_key)
where b.request_tagcode='${this.Request.Trim}'
and b.inner_request_tagcode='${this.Action.Trim}'
and b.task_tagcode='${this.Task.Trim}'
and b.item_tagcode='${this.Item.Trim}'
and b.unique_key='${this.UniqueKey.Trim}'
and b.repeatcounter=${this.RepeatCounter}
and b.repeatitemcounter=${this.RepeatItemCounter}
and b.repeatfieldcounter=${this.repeatfieldcounter}
${ImageLimit}"$