title: Case when between two data
body: <p>Hi I have to define a constraint with this case..</p>
  
  <pre><code>    [driver_surcharge_to] [tinyint] NULL CONSTRAINT CK_Vehicle_driverSurchargeTo CHECK (
          1 = case driver_surcharge_from
          when null
              case driver_age_to
                  when null then 1
                  else 0 end
          else
          case driver_age_to
                  when null then 0
                  when (driver_age_to) between 16 and 99 then 1
                  else 0 end
      end),
  </code></pre>
  
  <p>I have tried to put the same name field, and dont work with or without it.(brackets)</p>
  
  <p>How can I declare a case to verify his value between two numbers?</p>
  
  <p>Thanks.</p>