Home Forums SQL Server 2008 T-SQL (SS2K8) Finding Last Cost by article and compare with invoice line cost RE: Finding Last Cost by article and compare with invoice line cost

  • Hello Dohsan

    i understand your doubt but i need the range of my invoiceheader dates .

    without this range all invoices are appear.

    In pratice, and i don´t know if it is possible, i pretend to see all my invoice between 20150101 and 20150131, but for each article i need the last price cost (Last movement before or equal to my headerinvoice date).

    suppose the last movment on my table SL for the article AAA is on 20141031, and this article in on my invoice line that have a date of 20150115, i need to see the unitcost price on 20141031, independently of the invoice date are between 20150101 and 20150131, because is the last movment of my table SL before my invoice date.

    This is the unique form to see/check if the unitcostprice on invoice line are equal to the last unitcostprice of my table of movement of goods SL.

    Thanks for your help.

    Best regards

    Luis Santos