rjoseph
11-04-2007, 01:12 PM
Hi Guys
A friend kindly helped me find a soltuion which allowed me to display the average value of a numerical "price" field in my database onto my page.
However, the next stage is based on a further calculation. I now need to use the "average" figure that I have displayed on my page and set it against the "Price" figure to get the % increase.
For example,
------------record displayed on page-----------
Make: Porsche
Price: 45999.99
AvePrice of all Porsche 911's: 42999.45
Increase: 6.95%
------------------------------------------------
Has anyone got any ideas how I would display the % Increase within my results like shown above? The Ql statement I am currently using look as follows:
------------SQL------------
sqlStrB = "SELECT (CAST(SUM(PRICE) AS FLOAT) / COUNT(*)) AS [AvePrice] FROM mytable"
sqlStrB = sqlStrB & " where make = 'Porche'"
---------------------------
Any help would be fully appreciated.
Best regards
Rod from the UK
A friend kindly helped me find a soltuion which allowed me to display the average value of a numerical "price" field in my database onto my page.
However, the next stage is based on a further calculation. I now need to use the "average" figure that I have displayed on my page and set it against the "Price" figure to get the % increase.
For example,
------------record displayed on page-----------
Make: Porsche
Price: 45999.99
AvePrice of all Porsche 911's: 42999.45
Increase: 6.95%
------------------------------------------------
Has anyone got any ideas how I would display the % Increase within my results like shown above? The Ql statement I am currently using look as follows:
------------SQL------------
sqlStrB = "SELECT (CAST(SUM(PRICE) AS FLOAT) / COUNT(*)) AS [AvePrice] FROM mytable"
sqlStrB = sqlStrB & " where make = 'Porche'"
---------------------------
Any help would be fully appreciated.
Best regards
Rod from the UK