I need to query the values in one table repeatedly against records in a temporary table, while the system_user is the same value .... The temporary table @TmpTbl has three columns and data as per the example
usr startvalue endvalue
DOMAIN\user1 D10000 D10500
DOMAIN\user1 D10600 D10650
DOMAIN\user1 D10800 D10859
DOMAIN\user1 D10950 D10960
How can I find values in table DIM_DEPT where the values are between startvalue and endvalue for each row of the @TmpTbl where the usr = DOMAIN\user1 Simple "between" wouldnt work because the query returns more than one value each time?
how should the query look which can return values from the DIM_DEPT - in a table format, a single column, for the all values found between the start and end values of each row of the @TmpTbl?
This resulting table will be used as a parameter list in a SSRS report.