最近一次结算日期跟金额:
db_data4(~"select top 1 convert(varchar(100),a.app_date,23)+?+CONVERT(VARCHAR(10),cast(a.pay_amt as NUMERIC(18,2)) ),a.sheet_no from t_cust_accout_master a WHERE not EXISTS (SELECT 1 FROM t_cust_accout_detail b WHERE b.voucher_no=? AND a.sheet_no=b.sheet_no) AND a.cust_no=? ORDER BY a.sheet_no DESC~",~"付款~",sheet_no,db_data2(~"select cust_no from t_cust_accout_flow where sheet_no=?~",sheet_no))
截取名字:
if(len(item_name)>20,left(item_name,20),item_name)
if(len(item_name)>20,right(item_name,len(item_name)-20),'')
20代表10个汉字,根据需求变化。
截取名字时,当名字中既有汉字又有数字的时候,可能出现乱码,最好使用如下:
if(lenw(item_name)>20,leftw(item_name,20),item_name)
if(lenw(item_name)>20,rightw(item_name,lenw(item_name)-20),'')
20代表20个汉字,根据需求变化。