Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Last try simple way
DATA MODEL
I have 2 tables one with fields- Primary key SID, warrstart, warr end end and other table with con start, con end
Condition:
Warr end was limited to current fiscal year 2013
Issue:
Duplicates issue after resident load of max warr end and min constart
Example- when I join 2 tables
There are 3 same sids with warrstart, warrend dates following constart, conend dates for diff con_types
SID | Warr.CONTRACT_TYPE | Con.CONTRACT_TYPE | WARR START | WARR END | CON START | CON END |
1 | null | pp | 9/18/2013 | 3/17/2014 | 3/18/2014 | 9/17/2017 |
1 | ws | pp | 9/18/2013 | 3/17/2014 | 3/18/2014 | 9/17/2017 |
1 | ew | pp | 9/18/2013 | 3/17/2014 | 3/18/2014 | 9/17/2017 |
Requirement?
-Show me only max warend and a following min contract start date and there corresponding records for each sid and dont show other records
Testing:
When I try to test only one table for max warr start date then also I am getting duplicates
Example
SID | WARR_CON TYPE | WARR START | WARR END |
2 | Warranty Support | 01/04/2013 | 14/01/2014 |
2 | Warranty Support | 01/03/2013 | 14/01/2014 |
2 | Warranty Support | 14/11/2012 | 14/01/2014 |
In this case its picking max warr end but also all warr start dates which is not right it should be corresponding date for for max warr start date
I am using resident loads for max warr end and min con start for each table
Please help .................
Thanks in advance
I think it would be easier if you post your input data (or a sample / mock up of the data), and your requested results made out of the input.
Hello Swuehl
I attached a Sample QVW check it out
Output should be 1st criteria MAX WARR END DATE following MIN CONTRACT START DATE and corresponding dates
not supposed to get any duplicates but in the sample u can see some duplicates
Results expecting
ID | Warranty.CONTRACT_TYPE | WARR START | WARR END | CON START | CON END | Contracts.CONTRACT_TYPE |
1 | - | 02/04/2012 | 01/04/2013 | 01/10/2011 | 04/07/2014 | FS |
2 | EW | 01/01/2013 | 30/06/2013 | 11/03/2010 | 10/03/2014 | POP |
3 | EW | - | - | 01/04/2010 | 31/03/2014 | POP |
4 | WS | 11/03/2013 | 10/03/2014 | - | - | - |
5 | EW | 01/01/2013 | 30/06/2013 | 27/11/2012 | 26/11/2016 | POP |
6 | EW | 21/01/2013 | 20/07/2013 | 01/01/2013 | 31/12/2016 | POP |
7 | WS | 13/06/2012 | 12/06/2013 | 01/01/2013 | 31/12/2016 | POP |
8 | - | - | - | 12/03/2013 | 12/03/2013 | POP |
9 | - | 27/06/2012 | 26/06/2013 | 09/07/2012 | 30/06/2014 | PP |
10 | - | 26/12/2012 | 25/12/2013 | 15/06/2012 | 15/06/2012 | FS |