Running total in query

mattsteele8

Registered User.
Local time
Today, 23:13
Joined
Mar 18, 2009
Messages
11
hi,

I am trying to create a query that will allow me to catrgorise survey id's into different catchments. i have created the main part of the query but i am having issues creating a running total of the populations to categorise them by. the query is below and i need to have another field that is a running total of the PrecentTotalSample field. i have looked into dsum but apparently for it to work you have to have a unique id that the data is sorted by. i don't have one

please help

SELECT [2007_NSLSP_NF_P_RATES].NSLSP_id, [2007_NSLSP_NF_P_RATES].NSLSP_Location, [2007_NSLSP_NF_P_RATES].Postal_Sector, [2007_NSLSP_NF_P_RATES].Postal_Sector_Population, [2007_NSLSP_NF_P_RATES].[2007_Shopper_Population], [2007_NSLSP_NF_P_RATES].[2007_P_RATE], ([2007_shopper_population]*100)/[qrytotalshoppersample].[sumof2007_shopper_sample] AS PrecentTotalSample
FROM 2007_NSLSP_NF_P_RATES, qryTotalShopperSample
ORDER BY ([2007_shopper_population]*100)/[qrytotalshoppersample].[sumof2007_shopper_sample] DESC;
 

Users who are viewing this thread

Back
Top Bottom