Dim q As new QueryBuilder q.TableName = "会计凭证查询" q.C q.SelectString = "select * from [z_tablqpz] where sszt = 11 and pzrqn = " & vars("kn") & " union all select * from [z_tabdqpz] where sszt = 11 and pzrqn = 2008 union all select * from [z_tabxqpz] where sszt = 11 and pzrqn = 2008 order by pzrqn,pzrqy,pzlx,pzdm,flxh" q.Build