最近也遇到这个多表的操作,我所做的就是为了查询而已 但是不能如我yi !! 我定义了两个表:Employee 和OnDuty 其中有ID公共字段,我想统计所有员工的出勤次数: strsql:='select Employee.Name,count(*) as Times from OnDuty , Employee where (OnDuty.ID =Employee.ID) and DutyDate between # '+strDateStart+' # and # '+strDateEnd+' # group by Employee.Name'; 这样写了。但是运行时说“#"旁边有错误! 谢谢各位大侠 指点出其中的错误!
如果要修改的只是一张表的一个字段,那我把主键的值取出来,用update更新。
如果要更新的是多个记录,就只能把原来的查询条件取出来,用update,很复杂,很晕。
我想在DBGrid中更新多个表,并且是多条记录啊.
不行的话就自己写代码吧
但是不能如我yi !!
我定义了两个表:Employee 和OnDuty 其中有ID公共字段,我想统计所有员工的出勤次数: strsql:='select Employee.Name,count(*) as Times from OnDuty , Employee where (OnDuty.ID =Employee.ID) and DutyDate between # '+strDateStart+' # and # '+strDateEnd+' # group by Employee.Name';
这样写了。但是运行时说“#"旁边有错误!
谢谢各位大侠 指点出其中的错误!