You must Sign In to post a response.
  • Category: SQL Server

    How to get stock balance of every end of month

    Date Customer InvoiceNo StockBalance
    11/29/2017 A IN000414 5000
    11/30/2017 B IN000415 4000
    12/27/2017 A IN000416 3500
    12/30/2017 B IN000417 2000
    I want to get Stockbalance of every end of month, I need the output as

    11/30/2017 B IN000415 4000
    12/30/2017 B IN000417 2000
    how could i get this could anybody guide to me?
  • #769677
    can you try with below query.

    Select * from stock Where [Date] In(Select Max(Date) from stock group by Month(Date))

    B.Ramana Reddy

  • Sign In to post your comments