我在一个表中查询得出一个各部门能够分的钱的记录集。(假设为A表)
我在另一个表中查询得出一个各部门已分的钱的记录集。(假设为B表)
不要查出再比较,直接查询比较。select a.*,(a.Money-B.money) as MarGin from A,B where A.Depart=B.Depart and  a.Money >b.money所得记录就是没有分完的记录。

解决方案 »

  1.   

    最好在存储过程比较记录集,然后返回字符串给VB,不要在VB里比较两个记录集。
      

  2.   

    set rst = cnn.execute("select count(*) as nn from table1")
    n = rst!nn
    set rst = cnn.execute ("select count(*) as nn from table1, table2 where table1.depart=table2.depart and table1.money=tabel2.money")
    msgbox iif(rst!nn=n,"钱已分完!","钱还没分完!")
      

  3.   

    sindyzhou(sindy): 不好意思,你来晚了一点点,我结贴时没看到你。结完才看到你。