Dear All,
Need help to generate following View. Im having 2 entity InvoiceHeader, InvoiceHeaderline
Details As below:
Invoice Header | InvoiceHeaderLine | VIEW REQUIRED | ||||||||
InvoiceNo | Invoicedate | InvoiceNo | ItemNo | Amount | InvoiceNo | Invoicedate | ItemNo | Amount | ||
Inv1 | 01-01-2019 | Inv1 | Item1 | 100 | Inv2 | 02-01-2019 | Item1 | 100 | ||
Inv2 | 02-01-2019 | Inv1 | Item2 | 100 | Inv3 | 03-01-2019 | Item1 | 100 | ||
Inv3 | 03-01-2019 | Inv2 | Item1 | 100 | Inv3 | 03-01-2019 | Item2 | 100 | ||
Inv4 | 04-01-2019 | Inv3 | Item1 | 100 | Inv3 | 03-01-2019 | Item3 | 100 | ||
Inv3 | Item2 | 100 | Inv4 | 04-01-2019 | Item1 | 100 | ||||
Inv3 | Item3 | 100 | Inv4 | 04-01-2019 | Item2 | 100 | ||||
Inv4 | Item1 | 100 | ||||||||
Inv4 | Item2 | 100 |
Query:
SELECT * FROM [DBO].INVOICEHEADERLINE IH where InvoiceNo IN (SELECT TOP 3 InvoiceNo FROM INVOICEHEADER WHERE CUSTACCOUNT ='C008-03418' ORDER BY TRANSDATE DESC) |
Please provide FETCHXML for View or Any Suggestion |
*This post is locked for comments