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