G
Guest
From the following query
SELECT
Sum(IIf([daysvolume]<3,Abs([amktval]),0)/sum(abs(amktval))) AS ['1-3 Days'],
Sum(IIf([daysvolume] Between 3 And 5,[amktval],0)/sum(abs(amktval))) AS
['3-5 Days'],
Sum(IIf([daysvolume]>5,[amktval],0)/sum(abs(amktval))) AS ['>5 Days']
FROM
(SELECT Abs([deltaadjmktval])/([20dayavvol]*[price]/[rate]*[Enter % of
Volume]/100) AS DaysVolume,
DeltaAdjMktVal as aMktVal
FROM (MainDownload INNER JOIN AverageDailyVolume ON
MainDownload.UndBloomberg = AverageDailyVolume.BBG_Ticker) INNER JOIN FxRates
ON MainDownload.Ccy = FxRates.CCY2
WHERE ((MainDownload.DeltaAdjMktVal)<>0)
ORDER BY Abs([deltaadjmktval])/([20dayavvol]*[price]/[rate]*[Enter % of
Volume]/100) DESC) AS Liquidation;
I get the error that I cannot have an agregate function in my expression..
I have also tried dividing the sum of the days volume by another select
statement on the table [Liquidation] but I get another error message stating
the jet database does not recognise the table or query 'Liquidation' Is there
anyway I can accomplish what I want here - which in essence is finding the %
of abs(deltadjmktval) for each bucket
SELECT
Sum(IIf([daysvolume]<3,Abs([amktval]),0)/sum(abs(amktval))) AS ['1-3 Days'],
Sum(IIf([daysvolume] Between 3 And 5,[amktval],0)/sum(abs(amktval))) AS
['3-5 Days'],
Sum(IIf([daysvolume]>5,[amktval],0)/sum(abs(amktval))) AS ['>5 Days']
FROM
(SELECT Abs([deltaadjmktval])/([20dayavvol]*[price]/[rate]*[Enter % of
Volume]/100) AS DaysVolume,
DeltaAdjMktVal as aMktVal
FROM (MainDownload INNER JOIN AverageDailyVolume ON
MainDownload.UndBloomberg = AverageDailyVolume.BBG_Ticker) INNER JOIN FxRates
ON MainDownload.Ccy = FxRates.CCY2
WHERE ((MainDownload.DeltaAdjMktVal)<>0)
ORDER BY Abs([deltaadjmktval])/([20dayavvol]*[price]/[rate]*[Enter % of
Volume]/100) DESC) AS Liquidation;
I get the error that I cannot have an agregate function in my expression..
I have also tried dividing the sum of the days volume by another select
statement on the table [Liquidation] but I get another error message stating
the jet database does not recognise the table or query 'Liquidation' Is there
anyway I can accomplish what I want here - which in essence is finding the %
of abs(deltadjmktval) for each bucket