[solved] AVG() in mssql vs AVG() in mysql

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
waskelton4
Forum Contributor
Posts: 132
Joined: Mon Sep 09, 2002 6:42 pm

[solved] AVG() in mssql vs AVG() in mysql

Post by waskelton4 »

I've just converted a mysql DB to mssql and use the AVG aggregate function on a field..

where mysql would give me results using AVG on a text field..
msql requires a numeric field type...

problem is.. i'm storing text and numeric data in this field..
i'm only averaging the numeric data.. but it still needs to have text data in there

anyone know of an alternate field type or will i have to write lots of code to fix this.. or redesign my database .. (eeek)

any help is greatly apprecitated..

Thanks
ws
waskelton4
Forum Contributor
Posts: 132
Joined: Mon Sep 09, 2002 6:42 pm

Post by waskelton4 »

for anyone interested... this article handles my exact problem..

http://www.winnetmag.com/SQLServer/Arti ... 26968.html

hope it helps others


ws
Post Reply