datetime ldt_qsrq,ldt_zzrq
string ls_where
string sqlstring
int li_number
dw_2.settransobject(sqlca)
dw_1.accepttext()
dw_2.reset()
sqlstring = "SELECT temp_jmtj.report_no, temp_jmtj.name, temp_jmtj.medical_card_no, temp_jmtj.age, temp_jmtj.sex,temp_jmtj.family_name, temp_jmtj.town, temp_jmtj.street, temp_jmtj.tel, temp_jmtj.report_date, temp_jmtj.credit_card_no, temp_jmtj.si_card_no,'' as t_1 FROM temp_jmtj where "
ls_where=""
////==============================================================================
//// 根据输入的体检日期段确定检索条件
////==============================================================================
ldt_qsrq = DateTime(Date(dw_1.Object.databegin[1]),Time("00.00.00"))
ldt_zzrq = DateTime(Date(dw_1.Object.dataend[1]),Time("23.59.59"))
ls_where = ls_where + " temp_jmtj.report_date>= '" + string(ldt_qsrq) + "' " + " and temp_jmtj.report_date<='" + string(ldt_zzrq) + "' "
//////==============================================================================
////// 根据病人姓名确定检索条件
//////==============================================================================
if not isnull(dw_1.object.xm[1]) then
ls_where=ls_where+" and temp_jmtj.name like '"+trim(dw_1.object.xm[1])+"%'"
end if
//////==============================================================================
////// 根据输入的身份证号确定检索条件
//////==============================================================================
If Not IsNull(dw_1.Object.cardid[1]) then
ls_where = ls_where + " and temp_jmtj.medical_card_no= '" + trim(dw_1.Object.cardid[1]) + "'"
End If
//////==============================================================================
////// 根据输入家庭地址、工作单位确定检索条件
//////==============================================================================
if not isnull(dw_1.object.jtdz[1]) then
ls_where=ls_where+" and temp_jmtj.family_name like '"+trim(dw_1.object.jtdz[1])+"%'"
end if
//////==============================================================================
//////// 根据输入病人性质确定检索条件
////////============================================================================
if not isnull(dw_1.object.dwdz[1]) then
ls_where=ls_where+" and SQ_GRDA.t_1 like '"+trim(dw_1.object.dwdz[1])+"%'"
end if
sqlstring = sqlstring + ls_where
dw_2.setsqlselect(sqlstring)
li_number=dw_2.retrieve()
sle_1.text=string(li_number)
dw_2.setfocus()
提示出错:列前缀‘SQ_GRDA’与查询中所用的表名或别名不匹配。
datetime ldt_qsrq,ldt_zzrq
string ls_where
string sqlstring
int li_number
dw_2.settransobject(sqlca)
dw_1.accepttext()
dw_2.reset()
sqlstring = "SELECT temp_jmtj.report_no, temp_jmtj.name, temp_jmtj.medical_card_no, temp_jmtj.age, temp_jmtj.sex,temp_jmtj.family_name, temp_jmtj.town, temp_jmtj.street, temp_jmtj.tel, temp_jmtj.report_date, temp_jmtj.credit_card_no, temp_jmtj.si_card_no,'' as t_1 FROM temp_jmtj where "
ls_where=""
////==============================================================================
//// 根据输入的体检日期段确定检索条件
////==============================================================================
ldt_qsrq = DateTime(Date(dw_1.Object.databegin[1]),Time("00.00.00"))
ldt_zzrq = DateTime(Date(dw_1.Object.dataend[1]),Time("23.59.59"))
ls_where = ls_where + " temp_jmtj.report_date>= '" + string(ldt_qsrq) + "' " + " and temp_jmtj.report_date<='" + string(ldt_zzrq) + "' "
//////==============================================================================
////// 根据病人姓名确定检索条件
//////==============================================================================
if not isnull(dw_1.object.xm[1]) then
ls_where=ls_where+" and temp_jmtj.name like '"+trim(dw_1.object.xm[1])+"%'"
end if
//////==============================================================================
////// 根据输入的身份证号确定检索条件
//////==============================================================================
If Not IsNull(dw_1.Object.cardid[1]) then
ls_where = ls_where + " and temp_jmtj.medical_card_no= '" + trim(dw_1.Object.cardid[1]) + "'"
End If
//////==============================================================================
////// 根据输入家庭地址、工作单位确定检索条件
//////==============================================================================
if not isnull(dw_1.object.jtdz[1]) then
ls_where=ls_where+" and temp_jmtj.family_name like '"+trim(dw_1.object.jtdz[1])+"%'"
end if
//////==============================================================================
//////// 根据输入病人性质确定检索条件
////////============================================================================
if not isnull(dw_1.object.dwdz[1]) then
ls_where=ls_where+" and SQ_GRDA.t_1 like '"+trim(dw_1.object.dwdz[1])+"%'"
end if
sqlstring = sqlstring + ls_where
dw_2.setsqlselect(sqlstring)
li_number=dw_2.retrieve()
sle_1.text=string(li_number)
dw_2.setfocus()
提示出错:列前缀‘SQ_GRDA’与查询中所用的表名或别名不匹配。
if not isnull(dw_1.object.dwdz[1]) then
ls_where=ls_where+" and SQ_GRDA.t_1 like '"+trim(dw_1.object.dwdz[1])+"%'"
end if
提示出错:列前缀‘SQ_GRDA’与查询中所用的表名或别名不匹配。
datetime ldt_qsrq,ldt_zzrq
string ls_where
string sqlstring
int li_number
dw_2.settransobject(sqlca)
dw_1.accepttext()
dw_2.reset()
sqlstring = "SELECT temp_jmtj.report_no, temp_jmtj.name, temp_jmtj.medical_card_no, temp_jmtj.age, temp_jmtj.sex,temp_jmtj.family_name, temp_jmtj.town, temp_jmtj.street, temp_jmtj.tel, temp_jmtj.report_date, temp_jmtj.credit_card_no, temp_jmtj.si_card_no,'' as t_1 FROM temp_jmtj where "
ls_where=""
////==============================================================================
//// 根据输入的体检日期段确定检索条件
////==============================================================================
ldt_qsrq = DateTime(Date(dw_1.Object.databegin[1]),Time("00.00.00"))
ldt_zzrq = DateTime(Date(dw_1.Object.dataend[1]),Time("23.59.59"))
ls_where = ls_where + " temp_jmtj.report_date>= '" + string(ldt_qsrq) + "' " + " and temp_jmtj.report_date<='" + string(ldt_zzrq) + "' "
//////==============================================================================
////// 根据病人姓名确定检索条件
//////==============================================================================
if not isnull(dw_1.object.xm[1]) then
ls_where=ls_where+" and temp_jmtj.name like '"+trim(dw_1.object.xm[1])+"%'"
end if
//////==============================================================================
////// 根据输入的身份证号确定检索条件
//////==============================================================================
If Not IsNull(dw_1.Object.cardid[1]) then
ls_where = ls_where + " and temp_jmtj.medical_card_no= '" + trim(dw_1.Object.cardid[1]) + "'"
End If
//////==============================================================================
////// 根据输入家庭地址、工作单位确定检索条件
//////==============================================================================
if not isnull(dw_1.object.jtdz[1]) then
ls_where=ls_where+" and temp_jmtj.family_name like '"+trim(dw_1.object.jtdz[1])+"%'"
end if
sqlstring = sqlstring + ls_where
dw_2.setsqlselect(sqlstring)
li_number=dw_2.retrieve()
//////// 根据输入病人性质确定检索条件
////////============================================================================
if not isnull(dw_1.object.dwdz[1]) then
dw_2.setfilter("t_1= 1") //过滤统筹医保
dw_2.filter()
end if
怎么什么都检索不出来呀
string ls_str = '8823181282228222'
ls_str = mid(ls_str,8,1)
可在dw增加两虚拟列T_1,T_2
下面可用循环
if ls_str = '8' then
统筹医保
set T_1 = 1
else
普通医保
set T_2 = 1
end if
计算这两字段
还有一种就是用sql语句
以oracle为例
select
sum(case when substr(字段,8,1) = '8' then 1 else 0 end) as T_1, //统筹医保
sum(case when substr(字段,8,1) <> '8' then 1 else 0 end) as T_2 //普通医保
from dual;