Filips Benoit wrote:
Dear All,
Table: ArticleYearPrice
ART_ID
YEAR
PRICE
ART_ID YEAR PRICE
111 2006 1,00
111 2007 1,01
I want this list: ParameterQuery: compare [year1] and [year2]
ART_ID PRICE_YEAR1 PRICE_YEAR2 ABS_DIFFERENCE %
DIFFERENCE
111 1,00 1,01
0,1 1 %
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Untested:
PARAMETERS [Year1] Int, [Year2] Int;
SELECT T1.art_id, T1.price As Year1Price, T2.price As Year2Price,
T2.price - T1.price As AbsDifference,
(T2.price - T1.price)/T2.price As DifferencePct
FROM ArticleYearPrice As T1 INNER JOIN ArticleYearPrice As T2
ON T1.art_id = T2.art_id
WHERE T1.[Year] = [Year1]
AND T2.[Year] = [Year2]
--
MGFoster:::mgf00 <atearthlink <decimal-pointnet
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBRLL3gIechKqOuFEgEQKWaACg5TOQ23WpDXlnXmUR7FuC9w 0hdWwAnAit
aDGKuyylRrB0ei06sWxpmrCW
=ENcP
-----END PGP SIGNATURE-----