Newbie to this page. I need help with data linking in Microsoft SQL. I have two data tables both rather large data sets which I need to link somehow. My 1st data set shows the start and end date/time of a group and has a unique ID. The 2nd set does have a unique id but its not linkable to the first set. The only fields that I could link are on date /Time & Group. I am trying to have the 2nd table show the ID from the first table so that I can then join the data sets. Its a 1 time update and will not need to be refreshed.
I need to base link on the below:
IF ds2.Time is between ds1.Start_Time and ds1.End Time then ds1.ID
ds=data source
Data Source 1
ID Start Date End Date Start Time End Time Group
1 12/01/2010 12/01/2010 12:45 13:10 A
2 12/01/2010 12/01/2010 12:00 14:55 B
3 12/01/2010 12/01/2010 12:55 13:45 C
4 12/01/2010 12/01/2010 13:55 14:25 A
5 12/01/2010 12/01/2010 15:02 15:55 B
Data Source 2
Date Time Group Total ID
12/01/2010 12:45 A 13 ?
12/01/2010 12:46 A 15 ?
12/01/2010 12:47 A 8 ?
12/01/2010 12:48 B 10 ?
12/01/2010 13:55 B 8 ?
12/01/2010 13:57 B 9 ?
12/01/2010 13:58 B 10 ?
12/01/2010 13:59 B 12 ?
12/01/2010 14:01 B 14 ?
As I have posted I will post final answer if not able to find on page to help close out for others.