|
用 DoCmd.OpenQuery "查询xxx" 的方法不能自定义参数,
比方说我想让程序自动执行下面这个追加查询
INSERT INTO pa03OutRec ( PdGroup, BoxPn, OutDate, P01Date, P02Date )
SELECT pa03OutRec.PdGroup, pa03OutRec.BoxPn, Date() AS Today, Date()+1 AS DateP1, Date()+2 AS DateP2
FROM pa03OutRec
GROUP BY pa03OutRec.PdGroup, pa03OutRec.BoxPn, Date(), Date()+1, Date()+2, pa03OutRec.OutDate
HAVING (((pa03OutRec.PdGroup)="小组1") AND ((pa03OutRec.OutDate)=DMax("OutDate","pa03OutRec","PdGroup=[PdGroup]")));
每次我想通过程序追加“小组1”或者小组2,3,4.。。怎么实现?
之前没有做过这方面的程序,弄了几天都搞不定,高手给指点下 。。。或发个实例链接也行,多谢了。 |
|