You are here: Re: show number of values as % of total records..? « MsSQL Server « IT news, forums, messages
Re: show number of values as % of total records..?

Posted by Otto on 02/16/07 06:21

"Erland Sommarskog" <esquel@sommarskog.se> skrev i en meddelelse >

SELECT cast(100.0 * SUM (CASE Q1 WHEN 'nej' THEN 1 ELSE 0 END) / COUNT(*)
as decimal(5,2)) FROM tbl

Hi erland - thanks for your response- the code works in the way that I dont
get an error - but I dont really know how to get the number of records (in
Field Q1) and the % of these who have the value 'nej' out from this
code..:-(

You can see my Access version of webpage on
http://www.gymnasiereform.dk/svar_q12.asp
here it works fien - but I cant make it work with MY SQL which I'm trying t
migrate to.
Best wishe s- Otto

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация