'查询合同订单表中是否有根据当前日期生成的合同编号
dim htbh = ExecuteScalar("select nvl(max(CTR_ID) + 1, '"+mid(formatdatetime(date(),"yyyyMMdd"),2,len(formatdatetime(date(),"yyyyMMdd"))-2)+"01') from CTR_CONTRACT where CTR_ID like '"+mid(formatdatetime(date(),"yyyyMMdd"),2,len(formatdatetime(date(),"yyyyMMdd"))-2)+"%' ")