2,748
社区成员




Local sqllist as String
Local array aTemp[1]
TEXT to sqllist Noshow textmerge pretext 1+2+4+8
SELECT distinct
pat_name,
pat_sex,
pat_age_exp,
pat_tel,
pat_in_no,
pat_bar_code,
pat_report_date,
pat_dep_name,
res_itr_id,
cast(SUBSTRING(res_sid,1,3) as int) as sid
FROM clab.dbo.patients a,clab.dbo.resulto b
where a.pat_id=b.res_id and res_itr_id='10049'
and res_date>='<<thisform.txtbegin.value>> 00:00:00'
and res_date<='<<thisform.txtend.value>> 23:59:59'
order by sid
ENDTEXT
Do case
Case sqlexec(con_sqllist,sqllist,"list_temp") < 0
AError(aTemp)
MessageBox('查询错误' + Chr(13)+Chr(13) + aTemp[3])
Case Reccount("list_temp") < 1
MessageBox('没有查询到任何记录')
Otherwise
Thisform.checklist()
Use in Select('list_temp')
*-- Thisform.Refresh()
EndCase
If !Used('local_list')
Use local_list Shared In 0
EndIf
Select local_list
Scan all
patidx = patid
Select list_temp
Scan all
IF VAL(pat_in_no)=VAL(patidx)
With thisform.txtlist
.value = .value + ALLTRIM(pat_name) + "," + ALLTRIM(STR(sid)) + ";"
.SelStart = Len(.Value)
EndWith
ENDIF
EndScan
EndScan
*-- Use in Select('list_temp')
If !Used('local_list')
Use local_list Shared In 0
EndIf
Select local_list
Scan all
patidx = patid
If sqlexec(con_sqllist,sqllist,"list_temp") > 0
Select list_temp
Scan all
IF VAL(pat_in_no)=VAL(patidx)
With thisform.txtlist
.value = .value + ALLTRIM(pat_name) + "," + ALLTRIM(STR(sid)) + ";"
.SelStart = Len(.Value)
EndWith
ENDIF
EndScan
EndIf
EndScan
Use in Select('list_temp')