J
js
I have a table (call it tableA) structured like the
following:
ID DrugName Date Days
1 DrugA 01/01/2003 30
2 DrugB 03/05/2003 30
3 DrugA 02/28/2003 90
etc...
What I need to accomplish (and have had a very hard time)
is to find any 2 distinct drugs (drugA or B in this case)
that overlap in their usage.
So, ID=1 is DrugA filled on 01/01/2003 for a 30 day
supply. So the time period is 01/01/2003 + 30= 01/31/2003.
This does not overlap any other drugs, but ID=3 does
overlap with DrugB (ID=2) for the given time period.
How can I structure a query to help me with this? Right
now i have done it via a 12,000 step process that is still
not completely accurate..
thanks for ANY help anyone cand lend.
JS
following:
ID DrugName Date Days
1 DrugA 01/01/2003 30
2 DrugB 03/05/2003 30
3 DrugA 02/28/2003 90
etc...
What I need to accomplish (and have had a very hard time)
is to find any 2 distinct drugs (drugA or B in this case)
that overlap in their usage.
So, ID=1 is DrugA filled on 01/01/2003 for a 30 day
supply. So the time period is 01/01/2003 + 30= 01/31/2003.
This does not overlap any other drugs, but ID=3 does
overlap with DrugB (ID=2) for the given time period.
How can I structure a query to help me with this? Right
now i have done it via a 12,000 step process that is still
not completely accurate..
thanks for ANY help anyone cand lend.
JS