I'm trying to do a sql query to get data in a clause in between. The problems, is that i dont know how to do a query who can have differences clause between depends on the value in the parameter.

What i have:

```
SELECT TableA.DNSName, TableA.IPAddressStr, TableB.OSName
FROM TableB 
INNER JOIN TableA 
  ON TableB.AssetOSID = TableA.AssetOSID 
CROSS JOIN IPRanges
WHERE (IpRanges.ConfigID = @configID)
  (Assets.IPAddress BETWEEN IPRanges.StartIPAddress AND IPRanges.EndIPAddress)

```

what table look like:

```
IpRanges:
ConfigID|StartIpAdress|EndIPAdress <br>
1|23|53
1|56|87
3|90|134
3|560|600 
3|780|800 

```

As you can see the number of ipRanges changes on each configID and theres is no link between the table ipRanges And the table TableA.

Thanks in advance.