access数据库update a set icount=
(
select count(id) from b where b.ownum like '%'+mid(a.fnum,1,1)+'%' and b.ownum like '%'+mid(a.fnum,2,1)+'%'
)
where len(a.fnum)=2

解决方案 »

  1.   

    select 字查询可能有多个值
      

  2.   

    错误提示????select count(id) from b where b.ownum like '%'+mid(a.fnum,1,1)+'%' and b.ownum like '%'+mid(a.fnum,2,1)+'%',在这表查询还没有和A表连接!!select count(id) from b inner on a a.**=b.** where b.ownum like '%'+mid(a.fnum,1,1)+'%' and b.ownum like '%'+mid(a.fnum,2,1)+'%'
      

  3.   

    select count(id) from b--->select count(id) from b,a....
      

  4.   

    是啊,你如果用了A表的话,你要用连接的,不过Access我没用过,不知道是不是支持连接
      

  5.   

    没FORM A 何来a.fnum
      

  6.   

    update a set icount=
    (
    select count(id) from b where b.ownum like '%" + mid(a.fnum,1,1) + "%' and b.ownum like '%" + mid(a.fnum,2,1) + "%'
    )
    where len(a.fnum)=2
    注意单双引号.
      

  7.   

    不行的话就改为:
    update a set icount=
    (
    select count(id) from b where b.ownum like '%" & mid(a.fnum,1,1) & "%' and b.ownum like '%" & mid(a.fnum,2,1) & "%'
    )
    where len(a.fnum)=2
    注意单双引号.
      

  8.   

    update a set icount=
    (
    select count(id) from a, b where b.ownum like '%'+mid(a.fnum,1,1)+'%' and b.ownum like '%'+mid(a.fnum,2,1)+'%'
    )
    where len(a.fnum)=2
      

  9.   

    没有from a,执行一下看报什么错
      

  10.   

    “Free_Windy(自由风)”说得对,你的少了一个单引号。照“Free_Windy(自由风)”说的改一下就
      

  11.   

    select count(id) from b where b.ownum like '%'+mid(a.fnum,1,1)+'%' and b.ownum like '%'+mid(a.fnum,2,1)+'%'访问不到a的