hardeep.kanwar
Well-known Member
- Joined
- Aug 13, 2008
- Messages
- 691
Hello Experts
Today, I stuck with a different problem, I need to calculate numbers of days between 2 dates and also calculate the gap of days in yrs also.
[TABLE="width: 1172"]
<colgroup><col><col><col><col span="2"><col span="2"><col></colgroup><tbody>[TR]
[TD]See the below example
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][TABLE="width: 68"]
<tbody>[TR]
[TD="class: xl65, width: 68"]Start Date[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 68"][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 62"]
<tbody>[TR]
[TD="class: xl65, width: 62"]End Date[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 62"][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 67"]
<tbody>[TR]
[TD="class: xl65, width: 67"]Total Gap No. Days[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 80"]
<tbody>[TR]
[TD="class: xl65, width: 80"]No of Gap (yr) 2016[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 77"]
<tbody>[TR]
[TD="class: xl65, width: 77"]No of Gap (yr) 2017[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR]
[TD="class: xl65, width: 65"]No of Gap (yr) 2018[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 472"]
<tbody>[TR]
[TD="class: xl65, width: 472"]Remarks[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 68"]
<tbody>[TR]
[TD="class: xl65, width: 68, align: right"]25-11-17[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 62"]
<tbody>[TR]
[TD="class: xl65, width: 62, align: right"]10-01-18[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 62, align: right"][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]46[/TD]
[TD]0[/TD]
[TD]36[/TD]
[TD]0[/TD]
[TD][TABLE="width: 472"]
<tbody>[TR]
[TD="class: xl65, width: 472"]If years are Differenent than show the Value in both Yrs[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 68"]
<tbody>[TR]
[TD="class: xl65, width: 68, align: right"]01-01-17[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 62"]
<tbody>[TR]
[TD="class: xl65, width: 62, align: right"]02-02-17[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]32[/TD]
[TD][/TD]
[TD]0[/TD]
[TD][TABLE="width: 77"]
<tbody>[TR]
[TD="class: xl65, width: 77"] 364 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 472"]
<colgroup><col></colgroup><tbody>[TR]
[TD]if years are same in both in Column than Value should be ZERO in other Yr.[/TD]
[/TR]
[TR]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 68"]
<tbody>[TR]
[TD="width: 68, align: right"][/TD]
[/TR]
[TR]
[TD="width: 68, align: right"]01-01-16[/TD]
[/TR]
[TR]
[TD="width: 68, align: right"][/TD]
[/TR]
[TR]
[TD="width: 68, align: right"][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 62"]
<tbody>[TR]
[TD="class: xl65, width: 62, align: right"]06-06-16[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 67"]
<tbody>[TR]
[TD="class: xl65, width: 67, align: right"]157[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]157[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD][TABLE="width: 472"]
<colgroup><col></colgroup><tbody>[TR]
[TD]if years are same in both in Column than Value should be ZERO in other Yr.[/TD]
[/TR]
[TR]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 68"]
<tbody>[TR]
[TD="class: xl65, width: 68, align: right"]01-01-16[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 62"]
<tbody>[TR]
[TD="class: xl65, width: 62, align: right"]06-06-18[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 67"]
<tbody>[TR]
[TD="class: xl65, width: 67, align: right"]887[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 80"]
<tbody>[TR]
[TD="class: xl65, width: 80, align: right"]365[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 77"]
<tbody>[TR]
[TD="class: xl65, width: 77, align: right"]365[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR]
[TD="class: xl65, width: 65, align: right"]157[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Today, I stuck with a different problem, I need to calculate numbers of days between 2 dates and also calculate the gap of days in yrs also.
[TABLE="width: 1172"]
<colgroup><col><col><col><col span="2"><col span="2"><col></colgroup><tbody>[TR]
[TD]See the below example
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][TABLE="width: 68"]
<tbody>[TR]
[TD="class: xl65, width: 68"]Start Date[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 68"][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 62"]
<tbody>[TR]
[TD="class: xl65, width: 62"]End Date[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 62"][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 67"]
<tbody>[TR]
[TD="class: xl65, width: 67"]Total Gap No. Days[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 80"]
<tbody>[TR]
[TD="class: xl65, width: 80"]No of Gap (yr) 2016[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 77"]
<tbody>[TR]
[TD="class: xl65, width: 77"]No of Gap (yr) 2017[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR]
[TD="class: xl65, width: 65"]No of Gap (yr) 2018[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 472"]
<tbody>[TR]
[TD="class: xl65, width: 472"]Remarks[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 68"]
<tbody>[TR]
[TD="class: xl65, width: 68, align: right"]25-11-17[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 62"]
<tbody>[TR]
[TD="class: xl65, width: 62, align: right"]10-01-18[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 62, align: right"][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]46[/TD]
[TD]0[/TD]
[TD]36[/TD]
[TD]0[/TD]
[TD][TABLE="width: 472"]
<tbody>[TR]
[TD="class: xl65, width: 472"]If years are Differenent than show the Value in both Yrs[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 68"]
<tbody>[TR]
[TD="class: xl65, width: 68, align: right"]01-01-17[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 62"]
<tbody>[TR]
[TD="class: xl65, width: 62, align: right"]02-02-17[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]32[/TD]
[TD][/TD]
[TD]0[/TD]
[TD][TABLE="width: 77"]
<tbody>[TR]
[TD="class: xl65, width: 77"] 364 [/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 472"]
<colgroup><col></colgroup><tbody>[TR]
[TD]if years are same in both in Column than Value should be ZERO in other Yr.[/TD]
[/TR]
[TR]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 68"]
<tbody>[TR]
[TD="width: 68, align: right"][/TD]
[/TR]
[TR]
[TD="width: 68, align: right"]01-01-16[/TD]
[/TR]
[TR]
[TD="width: 68, align: right"][/TD]
[/TR]
[TR]
[TD="width: 68, align: right"][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 62"]
<tbody>[TR]
[TD="class: xl65, width: 62, align: right"]06-06-16[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 67"]
<tbody>[TR]
[TD="class: xl65, width: 67, align: right"]157[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]157[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD][TABLE="width: 472"]
<colgroup><col></colgroup><tbody>[TR]
[TD]if years are same in both in Column than Value should be ZERO in other Yr.[/TD]
[/TR]
[TR]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][TABLE="width: 68"]
<tbody>[TR]
[TD="class: xl65, width: 68, align: right"]01-01-16[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 62"]
<tbody>[TR]
[TD="class: xl65, width: 62, align: right"]06-06-18[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 67"]
<tbody>[TR]
[TD="class: xl65, width: 67, align: right"]887[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 80"]
<tbody>[TR]
[TD="class: xl65, width: 80, align: right"]365[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 77"]
<tbody>[TR]
[TD="class: xl65, width: 77, align: right"]365[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 65"]
<tbody>[TR]
[TD="class: xl65, width: 65, align: right"]157[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]