I just gave you an example as how you can get number of days when you've two dates .. range is always meant to be a two date points.

Would you mind explaining why this is not correct? What data you have and what is your desired output for that. It would be better if you provide sample data in the form of insert statement so that we can utilize it. e.g. insert into @tableName values (.....)