select * from table
where a >='1999' and b>='4'and a <='2000' and b<='9'

解决方案 »

  1.   

    select * from table where (a='1999' and b='4') or (a='2000' and b='9')
      

  2.   

    select * from table
    where (a ='1999' and b >='4') or  (a ='2000' and b<='9')
      

  3.   

    Declare @Date1 datetime,@date2 datetime
    Set @Date1='1999-04-01'
    Set @date2='2000-09-01'
    Select * from 表 where Cast(A as Char(4))+Cast(B as Char(2))
        =Cast(DatePart(Year,@Date1) as Char(4))
          +Cast(DatePart(Month,@Date1)) as Char(2)) Or
       Cast(A as Char(4))+Cast(B as Char(2))
        =Cast(DatePart(Year,@Date2) as Char(4))
          +Cast(DatePart(Month,@Date2)) as Char(2))
       
      

  4.   

    不懂你A、B是什么类型所以用Cast 转换成字符型,@Date1,@Date2可以是你从VB传过来的参数
      

  5.   

    Select * from 表 where a+b>='19994' and a+b<='20009'
      

  6.   

    呵呵.....
    Select * from 表 where Cast(a as Char(4))+Cast(b as Char(2)>='19994' and Cast(a as Char(4))+Cast(b as Char(2))<='20009'
      

  7.   

    select * from table
    where a >=1999 and b>=4and a <=2000 and b<=9
      

  8.   

    to:97866(weiLuang)
    这样不行,有12个月呢
      

  9.   

    --传入的参数@arg1,@arg2declare @arg1 integer,@arg2 integer 
    select @arg1 = 199904,@arg2 = 200309select * from tablename where (a*100 + b) between @arg1 and @arg2