How to calculate the midpoint

I have three fields date, low, high. I need to calculate the midpoint
of low and high and display it.

Date,Low,High
20071106,92.03,92.13
20071106,88.77,88.87
20071106,90.20,90.30
20071106,95.21,95.31
20071106,93.13,93.23
20071106,91.01,91.11
amj1020 [ Mi, 07 November 2007 15:48 ] [ ID #1864704 ]

Re: How to calculate the midpoint

On Wed, 07 Nov 2007 06:48:09 -0800, amj1020 wrote:

>I have three fields date, low, high. I need to calculate the midpoint
>of low and high and display it.

Hi amj1020,

SELECT "date", (low + high) / 2.0 AS midpoint
FROM YourTable;

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Hugo Kornelis [ Mi, 07 November 2007 23:27 ] [ ID #1864709 ]
Datenbanken » comp.databases.ms-sqlserver » How to calculate the midpoint

Vorheriges Thema: SQL 2005 32bit upgrade to 64bit possible?
Nächstes Thema: Aggregate Fun (Getting the Max out of MAX)...head scratcher