with qry_tmp do begin<br> Close;<br> SQL.Clear;<br> SQL.Add('select store_no from m_store_name where shot_name='''+cb_titop.text+''' and bu='''+cust_no+''' ');<br> Open;<br> s:='';<br> first;<br> for x:=1 to RecordCount do begin<br> s:=s+''''+trim(fieldbyname('store_no').asstring)+''''+',';<br> next;<br> end;<br> s:=copy(s,1,length(s)-1);<br> end;<br><br><br>參考這一個