I use data from an accounting system that has an intriguing way of storing opening stock balances for stock items. Each item has an opening stock balance for each financial year that it existed. Thus during year ended 2007, item 123 which was first used in 2005 would have a 2005 opening balance of 100, 2006 opening balance of 10, and a 2007 opening balance of 45. I presume this speeds up any queries as not all transactions need to be analysed to get a current balance, just those in the year in question.
Once a financial year end is run (and just to make things nicely complicated, our financial year end is June), all items have an entry created in the table to show the opening balance for the new financial year. Thus in the example above, a new entry would be generated showing a 2008 opening balance of say 60 once the 2007 year end process has been run.(only the year is stored, not the month)
No problem, I can link these dates to the company data file which records what financial year we are in, and obviously changes to the current year once I run a year end.
Except:
Quite often (in fact most of the time), the year end is not run until many months after the effective date – to allow for late accounting adjustments etc. Thus the item will still show an opening balance as at last year.
No problem except if new stock is added after the recorded year end, it has an opening balance dated in the next financial year. In our example it would now have a 2008 opening balance entry but only for the new items, older items will have 2007 as the year end has not been run
.
I use date ranges to calculate balances at a particular point of time and need to have a way of determining which opening balance to use. Thus if my date range is from 1st Feb 07 to 3st of July 07, my opening balance would be the one dated 2007 to which I would add all transactions since that date. However if I wanted a date range of 1st of July 07 to 31st July 07 my opening balance would be the one dated 2007 if I had not run the year end or 2008 if the year end had been run or if it was a new item
In summary, I need a method of determining which year end number to use as my starting point depending on what date parameters I am using
Sorry for the length of the explanation but any help would be appreciated
Steve