logic to calculate the missing record
Posted: Wed Feb 15, 2017 11:16 pm
Hi All,
Can you please help me with the logic for the following requirement
INPUT:
ID | MM Number | From | To
12345|4444444|2015-01-03|2015-02-02
12346|4444444|2015-02-03|2015-03-02
<< missing one record ( ex same MM Number no record for period from 2015-03-03 to 2015-04-02
12347|4444444|2015-04-03|2015-05-01
12348|4444444|2015-05-02|2015-06-01
12349|4444444|2015-06-02|2015-07-01
12310|4444444|2015-07-02|2015-07-31
<< missing one record (ex: same MM Number no record for period from 2015-08-01 to 2015-08-31
12310|4444444|2015-09-01|2015-09-30
12310|4444444|2015-10-01|2015-10-31
Out put:
MM No | Missing Start Date | Missing To Date | Missing Days
4444444 |2015-03-03 |2015-04-02|30
4444444 |2015-08-01 |2015-08-31|30
Can you please help me with the logic for the following requirement
INPUT:
ID | MM Number | From | To
12345|4444444|2015-01-03|2015-02-02
12346|4444444|2015-02-03|2015-03-02
<< missing one record ( ex same MM Number no record for period from 2015-03-03 to 2015-04-02
12347|4444444|2015-04-03|2015-05-01
12348|4444444|2015-05-02|2015-06-01
12349|4444444|2015-06-02|2015-07-01
12310|4444444|2015-07-02|2015-07-31
<< missing one record (ex: same MM Number no record for period from 2015-08-01 to 2015-08-31
12310|4444444|2015-09-01|2015-09-30
12310|4444444|2015-10-01|2015-10-31
Out put:
MM No | Missing Start Date | Missing To Date | Missing Days
4444444 |2015-03-03 |2015-04-02|30
4444444 |2015-08-01 |2015-08-31|30