Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have two tables in my application. Table 1 has following fields:
[Start Time] [End Time] [Details]
09/18/2014 18:00 09/18/2014 18:30 DNM
Table 2 has following fields:
[Time of Action] [Other Details]
09/18/2014 18:14 DNC1
09/18/2014 18:20 DNC2
I want to create a master table such that if the [Time Action] is between the [Start Time] and [End Time], I append all the details. The final table which I want is similar to this:
[Start Time] [End Time] [Details] [Time of Action] [Other Details]
09/18/2014 18:00 09/18/2014 18:30 DNM 09/18/2014 18:14 DNC1
09/18/2014 18:00 09/18/2014 18:30 DNM 09/18/2014 18:14 DNC2
Is this possible?
Exactly for that purpose the IntervalMatch function has an extended syntax. You can pass the ID as extra parameter. See this discussion for an example: Between / subquery /intervalmatch(?) issue
You need to apply Interval Match command we have lot of example in community for interval match search
and use it.
Vikas
You can use the intervalmatch function. See this blog post for an example: IntervalMatch
Thanks Gysbert - however, as I was reading about Interval Match i realized that there is an additional challenge.
There is an ID column in both the tables and I need to ensure that the ID's are same while linking the two tables. Is there a way to implement this?
Once again, thanks a lot for your help.
Exactly for that purpose the IntervalMatch function has an extended syntax. You can pass the ID as extra parameter. See this discussion for an example: Between / subquery /intervalmatch(?) issue
Balaji,
Hope this will help you.
Thanks,
AS