Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to join 2 tables

Hi,

I have the below join situation in SQL Server and works fine.

However, how can I create the join in Bold with QV? I can create the #Raw and #Stats within QV and the common fields  BusinessDateand & sUser will create the join I need but how can I create the third join  r.id BETWEEN s.StartID AND s.FinishID

select * from #Raw R

LEFT join #Stats as S

on R.BusinessDate= S.BusinessDate

and R.sUser = S.sUser

AND r.id BETWEEN s.StartID AND s.FinishID

Maybe, I could load the data into another dataset within the Script  but that leaves me with only 1 table effectively, I would like to have 2 and have the join between them.

Thanks very much for any answers.

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

Use an IntervalMatch: See IntervalMatch

HIC

View solution in original post

1 Reply
hic
Former Employee
Former Employee

Use an IntervalMatch: See IntervalMatch

HIC