I have data following data structure..
   _ID             _BEGIN           _END    
    7003            99210            99217        
    7003            10225            10324    
    7003            111111
I want to look through every _BEGIN and _END and return all rows where the input value is between the range of values including the values themselves (i.e. if 10324 is the input, row 2 would be returned)
I have tried this filter but it does not work..
where @theInput between a._BEGIN and a._END
--THIS WORKS 
where convert(char(7),'10400') >= convert(char(7),a._BEGIN) 
--BUT ADDING THIS BREAKS AND RETURNS NOTHING
AND convert(char(7),'10400') < convert(char(7),a._END)
 
     
     
     
    