SQLScholar
Programmer
Hey all,
We have data that looks like this for table one
Date Policy number
01/10/2006 JA10
01/11/2006 JA10
01/10/2007 JA10
01/11/2007 JA10
and a another that looks like this
Policy number Start Date End date GUID
JA10 01/12/2005 31/11/2006 12312712312
JA10 01/12/2006 31/11/2007 91274728167
(i know the guids are real - they are on the DB).
Basically there should have been a join between these two tables - and there isnt. What we really need is to corrolate the date within the TABLE1 to get the guid out of TABLE2. So effectively the first two rows in TABLE1 fall between the start and end dates in table 2 of the first record (for this policy number - there will be many others). So it gets assigned "12312712312". The second two fall into the dates of the second line and be given "91274728167".
Is there any code that could do this? I cant think of how this would work?
Also we have another issue - there may be a few where they dont fall into either. In this case i need to leave them blank for me to work on later (or null).
Any ideas what to look at?
Dan
----------------------------------------
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Dr. Seuss
Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------
We have data that looks like this for table one
Date Policy number
01/10/2006 JA10
01/11/2006 JA10
01/10/2007 JA10
01/11/2007 JA10
and a another that looks like this
Policy number Start Date End date GUID
JA10 01/12/2005 31/11/2006 12312712312
JA10 01/12/2006 31/11/2007 91274728167
(i know the guids are real - they are on the DB).
Basically there should have been a join between these two tables - and there isnt. What we really need is to corrolate the date within the TABLE1 to get the guid out of TABLE2. So effectively the first two rows in TABLE1 fall between the start and end dates in table 2 of the first record (for this policy number - there will be many others). So it gets assigned "12312712312". The second two fall into the dates of the second line and be given "91274728167".
Is there any code that could do this? I cant think of how this would work?
Also we have another issue - there may be a few where they dont fall into either. In this case i need to leave them blank for me to work on later (or null).
Any ideas what to look at?
Dan
----------------------------------------
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind - Dr. Seuss
Computer Science is no more about computers than astronomy is about telescopes - EW Dijkstra
----------------------------------------