Check if #>Variable<#

Is it possible to check if a variable is greater than on number, but less than another?
Like this:

if (dist <= 2)(dist >= 1)

(Yes I know that code wont work)

if (dist >= 1  dist <= 2)

Thanks!