J
jas0n
tblTransfer is used to hold data of where our assets are in the company and
which internal contract to charge for each weeks period of hire. As they are
moved to a different contract we enter them into tblTransfer so we have a
history of where they have been and use this query to find out where they
are in the week of the cut off date and charge the internal cost centres.
It works fine doing it weekly but we want to move this to be done once per
month, either on a 4 or 5 week charging month depending on the accounting
calendar.
So, this query needs to run against the tblTransfer for each week for 4 or 5
weeks prior to the cut off date - then colate the information.
Im at a loss where to start with this, can anyone help?
PARAMETERS [What is the Cutoff Date] DateTime;
SELECT [ItemNo], [ContractNo], [DateOfTransfer], [ItemUser]
FROM tblTransfer AS E
WHERE E.DateofTransfer = (SELECT MAX(T.DateOfTransfer)
FROM tblTransfer as T
WHERE T.ItemNo = E.ItemNo
AND T.DateOfTransfer <= NZ([What is the Cutoff Date],#1/1/2299#));
which internal contract to charge for each weeks period of hire. As they are
moved to a different contract we enter them into tblTransfer so we have a
history of where they have been and use this query to find out where they
are in the week of the cut off date and charge the internal cost centres.
It works fine doing it weekly but we want to move this to be done once per
month, either on a 4 or 5 week charging month depending on the accounting
calendar.
So, this query needs to run against the tblTransfer for each week for 4 or 5
weeks prior to the cut off date - then colate the information.
Im at a loss where to start with this, can anyone help?
PARAMETERS [What is the Cutoff Date] DateTime;
SELECT [ItemNo], [ContractNo], [DateOfTransfer], [ItemUser]
FROM tblTransfer AS E
WHERE E.DateofTransfer = (SELECT MAX(T.DateOfTransfer)
FROM tblTransfer as T
WHERE T.ItemNo = E.ItemNo
AND T.DateOfTransfer <= NZ([What is the Cutoff Date],#1/1/2299#));