0

How can i make this work

    where 
case [a].[ndex]
    when [b].[aantal] = 0 then 0
    when [b].[aantal] = 1 then 0 and 1 
    when [b].[aantal] = 2 then 0 and 1 and 2
end

1 Answers1

0

You seem to want logic like this, assuming that aantal is an integer and ndex is never negative:

where [a].[ndex] <= [b].[aantal]

You might want to limit this to a specific range:

where [a].[ndex] between 0 and [b].[aantal] and
      [b].[aantal] between 0 and 2
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786