Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access 1

Status
Not open for further replies.

arab1

Technical User
Jan 11, 2006
2
IE
i have a report that outputs a contractID date and a number that was enter through a form.

i need to calculate table row - prevous the row in the same table for the same contract, and out put it to a report.
 
arab1,
How about some sample data and desired output in the report?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Contact ID Today Date Tonnage for the Week
bu1234 05/01/2002 100
bu1234 04/02/2002 120
bu1234 02/03/2002 150
the Contact ID Today Date Tonnage for the Week is enter in throught a form.
What i need is 100 -120 = 20 and put in to a report
120 - 150 = 30 and put in to a report
i have in my report Contact ID Today Date Tonnage for the Week but i need one week - the previous week
i would be very thankfull for any help

 
You would normally do this in a query. Try something like:
Code:
SELECT tblNoName.*, (SELECT TOP 1 [Tonnage For the Week]
FROM tblNoName N WHERE N.[Today Date]<tblNoName.[Today Date] ORDER BY [Today Date] DESC) as LastWeekTonnage
FROM tblNoName;

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top