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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing different records in a query result

Status
Not open for further replies.

mbthaz

Technical User
Aug 29, 2002
44
US
I have a query that pulls data that results in weekkly grouped results. It pulls data results and averages them to a weekly average. The problem I have is that I must also show percentage difference between the weeks...ie.
if week 1 is 20% and week 2 is 45% then there is a percentage increase of 225%(winging the math here). How do I access the previous rows data for calculations like this or if there is a way, please let me know. The query is listed below, don't know if it helps.

Thanks,

Mike

SELECT IOC_Rate_base_qry.[Team Lead], IOC_Rate_base_qry.[Remote-Deskside], Min(IOC_Rate_base_qry.Date) AS [Week Beginning], IOC_Rate_base_qry.[Remote-Deskside], Sum(IOC_Rate_base_qry.[# of Obs]) AS [SumOf# of Obs], Avg(IOC_Rate_base_qry.InterviewRate) AS AvgOfInterviewRate, Avg(IOC_Rate_base_qry.OfferRate) AS AvgOfOfferRate, Avg(IOC_Rate_base_qry.CloseRate) AS AvgOfCloseRate
FROM IOC_Rate_base_qry
GROUP BY IOC_Rate_base_qry.[Team Lead], IOC_Rate_base_qry.[Remote-Deskside], IOC_Rate_base_qry.[Remote-Deskside], (Year([Date])*CLng(54)+DatePart("ww",[Date],0)-1), (Format([Date],"ww"" '""yy"))
ORDER BY IOC_Rate_base_qry.[Team Lead];
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top