ReceiptDesc>
<Receipt>
po_nbr>123</po_nbr>
ReceiptDtl>
<receipt_date>
<year>1978</year>
<month>3</month>
<day>5</day>
<hour>1</hour>
<minute>6</minute>
<second>3</second>
</receipt_date>
<receipt_nbr>26</receipt_nbr>
</ReceiptDtl>
<ReceiptDtl>
<receipt_date>
<year>1979</year>
<month>3</month>
<day>5</day>
<hour>1</hour>
<minute>6</minute>
<second>3</second>
</receipt_date>
<receipt_nbr>26</receipt_nbr>
</ReceiptDtl>
<ReceiptDtl>
<receipt_date>
<year>1980</year>
<month>3</month>
<day>5</day>
<hour>1</hour>
<minute>6</minute>
<second>3</second>
</receipt_date>
<receipt_nbr>27</receipt_nbr>
</ReceiptDtl>
<ReceiptDtl>
<receipt_date>
<year>1978</year>
<month>3</month>
<day>5</day>
<hour>1</hour>
<minute>6</minute>
<second>3</second>
</receipt_date>
<receipt_nbr>28</receipt_nbr>
</ReceiptDtl>
</Receipt>
</ReceiptDesc>
IN the above scenario for a po_nbr we have some receipts and each receipt have multiple ReceiptDtls and some ReceiptDtls have same receipt_nbr the problem is if receipt_nbr is same we have to take the last receipt_date how can we do that
Here we have receipt_nbr=26 but the receipt_date is diff we need to take 1979 not 1978 how to do that