A表
VENIDVENNAME
公司
公司
B表
DOCNO VENID CDATE
C表
DOCNO PLU STORY
(我现在要根据 PLU或者DOCNO或者CDATE来查询得到记录并如下列出)
单号(DOCNO) 公司名称(VENNAME) 日期(CDATE)
公司
公司
公司
方法一
select * from AB where AVENID=BVENID and DOCNO in(select DOCNO from C where DOCNO="&s_dingdan&" or PLUID="&s_tiaoma&")order by RECEDATE desc
方法二
select * from AB where AVENID=BVENID and DOCNO in(select DOCNO from B where(replace(CONVERT(char()CREATEDATE)/) between "&s_riqi&" and "&s_riqi&")) order by RECEDATE desc"
select * from AB where AVENID=BVENID and DOCNO in(select DOCNO from C where DOCNO="&s_dingdan&" or PLUID="&s_tiaoma&")order by RECEDATE desc