G
Gil Lopes via AccessMonster.com
Hi all!
I' m trying to use SQL to obtain 4 series of percentages from a table.
My SQL looks like this:
SELECT UPsAbertos.Data, ((select UPsAbertos.Cotação from UpsAbertos where
UpsAbertos.[nome do fundo]='SGF Património Reforma Garantido')/5-1) AS Gar, (
(select UPsAbertos.Cotação from UpsAbertos where UpsAbertos.[nome do fundo]
='SGF Património Reforma Prudente')/1.09640-1) AS Pru, ((select UPsAbertos.
Cotação from UpsAbertos where UpsAbertos.[nome do fundo]='SGF Património
Reforma Equilibrado')/5-1) AS Equ,((select UPsAbertos.Cotação from UpsAbertos
where UpsAbertos.[nome do fundo]='SGF Património Reforma Acções')/5-1) AS Acc
FROM UPsAbertos
WHERE (((UPsAbertos.Data)>=#12/31/2002# And (UPsAbertos.Data)<=[forms]!
[cartaz]![cartazdata]))
ORDER BY UPsAbertos.Data DESC;
UpsAbertos is a table where I have the prices for these 4 products SGF Pat...
It has 3 fields: Data (date), Nome do Fundo (product ID) and Cotação (price).
So, this query should return the percentage evolution of the 4 products
ordered by date.
This SQL is giving me the error "This Subquery can only return one result",
and doesn' t run.
Can anyone see where I' m going wrong?
Many thanks,
Gil
I' m trying to use SQL to obtain 4 series of percentages from a table.
My SQL looks like this:
SELECT UPsAbertos.Data, ((select UPsAbertos.Cotação from UpsAbertos where
UpsAbertos.[nome do fundo]='SGF Património Reforma Garantido')/5-1) AS Gar, (
(select UPsAbertos.Cotação from UpsAbertos where UpsAbertos.[nome do fundo]
='SGF Património Reforma Prudente')/1.09640-1) AS Pru, ((select UPsAbertos.
Cotação from UpsAbertos where UpsAbertos.[nome do fundo]='SGF Património
Reforma Equilibrado')/5-1) AS Equ,((select UPsAbertos.Cotação from UpsAbertos
where UpsAbertos.[nome do fundo]='SGF Património Reforma Acções')/5-1) AS Acc
FROM UPsAbertos
WHERE (((UPsAbertos.Data)>=#12/31/2002# And (UPsAbertos.Data)<=[forms]!
[cartaz]![cartazdata]))
ORDER BY UPsAbertos.Data DESC;
UpsAbertos is a table where I have the prices for these 4 products SGF Pat...
It has 3 fields: Data (date), Nome do Fundo (product ID) and Cotação (price).
So, this query should return the percentage evolution of the 4 products
ordered by date.
This SQL is giving me the error "This Subquery can only return one result",
and doesn' t run.
Can anyone see where I' m going wrong?
Many thanks,
Gil