1,,字符串操作
mid(字符串,開始位置,字符個數(shù))
left(字符串,instr(字符串,"結束標識"))
update 總表 set 市=Mid(配送地址,1,5) ,區(qū)縣=Mid(配送地址,6,3),鎮(zhèn)=left(Mid(配送地址,9,4),instr(Mid(配送地址,9,4),"鎮(zhèn)")),詳細地址=Mid(配送地址,8,20);
2,控件添加事件
Private Sub Command8_Click()
DoCmd.RunSQL "select count(*) as [2G用戶數(shù)],sum([分攤前出賬金額(元)]) as [2G收入]," _ & "(select count(*) from [當月3G用戶明細]) as [3G用戶數(shù)],(select sum([分攤前出賬金額(元)]) from [當月3G用戶明細]) as [3G收入], " _ & "(select count(*) from [當月4G用戶明細]) as [4G用戶數(shù)],(select sum([分攤前出賬金額(元)]) from [當月4G用戶明細]) as [4G收入]," _ & "(select count(*) from [當月出賬明細]) as [合計用戶數(shù)],(select sum([分攤前出賬金額(元)]) from [當月出賬明細]) as [合計收入]into [當月匯總]" _ & "from [當月2G用戶明細]" End Sub 注:set子句中不能有子查詢,,所以直接在select中嵌入select設置字段值,。 |
|
來自: 哈飛揚 > 《access知識》