Weekly charging report

B

Ben

I am writing a database for charging out items of equipment on a weekly
hire basis to the various cost centres of the business.

I have tables for:-

Items (pk-ItemNo, Description, Serial No, Rate)
Contracts (pk-ContractNo, Contract Name)
Transfers (pk-autonumber, ItemNo, ContractNo, Date)

I will populate the items, contracts & transfers tables by copying all
the current data in from an excel spreadsheet at which point that day
will be considered the start date.

Im then using a form to enter each new transfer.

If an item transfers during a particular week it is to be charged to
both the current and new contracts.

The item is to be charged for every week until it is disposed of.

The transfers table I am using to note each date an item transfers to
another contract. I need to get a report that gives the current location
of each item, by contract and totals the value to be charged - its to be
based on either todays date or a date I specify to be able to create
historical reports.

The report is likely to be run weekly and then entered into a new
accounting system to pass the charges through to the contracts. The new
system isnt ready to do this yet and wont be for a year or so.

Would I create a query that lists all items from transfers but filters
out the multiple transfers and leaves the last one in place providing it
is before the date specified? Havent a clue how to go about doing that.

Any ideas please?
 
G

Guest

To get the last transfer for an item you need a query like:
SELECT TOP 1 FROM tblTransfers WHERE ItemNo = [MyItem] ORDER BY TransferDate
DESC

This will sort the transfers for an item by date and take the most recent one.

-Dorian
 
B

Ben

To get the last transfer for an item you need a query like:
SELECT TOP 1 FROM tblTransfers WHERE ItemNo = [MyItem] ORDER BY TransferDate
DESC

This will sort the transfers for an item by date and take the most recent one.

-Dorian

ok, how could I get that to work for multiple items?

the report is to pull out the most recent entry for each item, then
display it by contract number calculating the total for each contract.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top