Microsoft KB Archive/124979

BUG: Str (avg (float column)) May Return Incorrect Results

PSS ID Number: Q124979 Article last modified on 01-19-1995

4.20 4.20a

OS/2

BUG#: OS/2: 1517 (4.2)

= SYMPTOMS =

Microsoft SQL Server for OS/2 may return incorrect results or general protection fault (GP fault) when the str function is used on the results of the aggregate function avg. The avg function must have float column as an argument.

Example Query: select str (avg(float_column)) from my_table

= WORKAROUND =

Instead of using the str function, use the convert function to convert the aggregated float expression to a character string.

The above query may be rewritten as:

select convert(char (25), avg(float_column)) from my_table

= STATUS =

Microsoft has confirmed this to be a problem in SQL Server versions 4.2 and 4.2a for OS/2. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Additional reference words: 4.20 4.20a KBCategory: kbprg KBSubCategory: SSrvServer

=
================================================================

Copyright Microsoft Corporation 1995.