select * from 
where A between 时间 and 时间 
and (员工编号1='0000' or 员工编号2='0000')

解决方案 »

  1.   

    select * from
    where A between 时间 and 时间
    and (员工编号1='0000' or 员工编号2='0000')
      

  2.   

    select * from where A between 时间 and 时间 and (员工编号1='0000' or 员工编号2='0000')
      

  3.   

    如果员工编号1和员工编号2只要满足其中之一:
    select * from  where A between 时间 and  时间 and (员工编号1='0000'  or 员工编号2='0000')
    如果员工编号1和员工编号2都要满足:
    select * from  where A between 时间 and  时间 and (员工编号1='0000'  and 员工编号2='0000')
      

  4.   

    select A,D,B from table_A where B='0000'  and (A >='' and A <= '')
    union
    select A,E,C from table_A where C='0000'  and (A >='' and A <= '')
      

  5.   


    select Count(table_B.D) TotleManey, table_B.B Name
    from
    (
    select A,D,B from table_A where B='0000'  and (A >='' and A <= '')
    union
    select A,E,C from table_A where C='0000'  and (A >='' and A <= '')
    ) table_B
    group by table_B.B
    这是获取这个时间段编号为‘0000’这个员工的所获得的总金额
      

  6.   

    sql语句就是烦人,我前几天也差点没被它搞死
    这里有个自动生成sql语句的小程序,如感兴趣,可以看看
    http://www.codeproject.com/cs/database/SQLStatementGenerator.asp
      

  7.   

    select sum(D+E) as 员工所得 from 表名 where datediff(dd,起始时间,A)>=0 and datediff(dd,A,结束时间)>=0 and (B='0000' or C='0000')