Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How to get the closing balance to be the opening balance of the following month

How to get the closing balance to be the opening balance of the following month

Scheduled Pinned Locked Moved Database
helptutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vusamozi
    wrote on last edited by
    #1

    select StockNumber,InventoryName,Year1,Month1,RECEIVE_FROM_PO,RECEIVE_XFER,RECEIVE_ADJ,
    _RETURN,ADJUSTMENT,ISSUE,PT_ISSUE,TRANSFER, SUM(ABS(RECEIVE_FROM_PO + RECEIVE_XFER + RECEIVE_ADJ + _RETURN))

    • SUM(ABS(ADJUSTMENT + ISSUE + PT_ISSUE + TRANSFER))
      as BALANCE, BALANCE as OPENING_BAL
      into final2
      from dbo.drug_summary$
      GROUP BY StockNumber,InventoryName,Year1,Month1,RECEIVE_FROM_PO,RECEIVE_XFER,RECEIVE_ADJ,
      _RETURN,ADJUSTMENT,ISSUE,PT_ISSUE,TRANSFER,BALANCE

    :confused:

    L A 2 Replies Last reply
    0
    • V vusamozi

      select StockNumber,InventoryName,Year1,Month1,RECEIVE_FROM_PO,RECEIVE_XFER,RECEIVE_ADJ,
      _RETURN,ADJUSTMENT,ISSUE,PT_ISSUE,TRANSFER, SUM(ABS(RECEIVE_FROM_PO + RECEIVE_XFER + RECEIVE_ADJ + _RETURN))

      • SUM(ABS(ADJUSTMENT + ISSUE + PT_ISSUE + TRANSFER))
        as BALANCE, BALANCE as OPENING_BAL
        into final2
        from dbo.drug_summary$
        GROUP BY StockNumber,InventoryName,Year1,Month1,RECEIVE_FROM_PO,RECEIVE_XFER,RECEIVE_ADJ,
        _RETURN,ADJUSTMENT,ISSUE,PT_ISSUE,TRANSFER,BALANCE

      :confused:

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Looks correct (enough) to me :thumbsup: What's wrong with it? Missing table?

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] They hate us for our freedom![^]

      1 Reply Last reply
      0
      • V vusamozi

        select StockNumber,InventoryName,Year1,Month1,RECEIVE_FROM_PO,RECEIVE_XFER,RECEIVE_ADJ,
        _RETURN,ADJUSTMENT,ISSUE,PT_ISSUE,TRANSFER, SUM(ABS(RECEIVE_FROM_PO + RECEIVE_XFER + RECEIVE_ADJ + _RETURN))

        • SUM(ABS(ADJUSTMENT + ISSUE + PT_ISSUE + TRANSFER))
          as BALANCE, BALANCE as OPENING_BAL
          into final2
          from dbo.drug_summary$
          GROUP BY StockNumber,InventoryName,Year1,Month1,RECEIVE_FROM_PO,RECEIVE_XFER,RECEIVE_ADJ,
          _RETURN,ADJUSTMENT,ISSUE,PT_ISSUE,TRANSFER,BALANCE

        :confused:

        A Offline
        A Offline
        AmitGajjar
        wrote on last edited by
        #3

        Opening balance of current year is the closing balance of the previous year, and closing balance of the current year would be opening balance of the next year. If this is clear for you then you can calculate from your data. Let me know if you still having some issue.

        Thanks -Amit Gajjar (MinterProject)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups