文件abc.mdb中有两张表,
tab1中有:批次编号  生产日期   生产部门 
tab2中有:产品编号  批次编号   品名  规格  颜色要显示生产日期在最近一个月内所有批次的所有产品的:产品编号  批次编号   品名  

解决方案 »

  1.   

    try:
        select [产品编号],a.[批次编号],[品名]
        from tab2 a inner join tab1 b
        on a.[批次编号]=b.[批次编号]
        where [生产日期] between #dateadd('m',-1,date)# and #date#
      

  2.   

      select b.产品编号,  b.批次编号,  b.品名
    from tab1 as a
       , tab2 as b
    where a.批次编号 = b.批次编号
      and a.生产日期 between DATEADD("m",-1,date())  and date()  
      

  3.   

    select b.产品编号,  b.批次编号,  b.品名 
    from tab1 as a 
      , tab2 as b 
    where a.批次编号 = b.批次编号 
      and a.生产日期 between DATEADD("m",-1,date())  and date()