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

Posted by Otto on 02/15/07 21:24

Hi
I'm migrating from Access til MySQL.
Works fine so far - but one thing is nearly killing me:

I got the count of total records in a variabel - (antalRecords)
I got the count for the Field Q1 where the value value is = 'nej'
Now I just need to calculate how many % of my records have the value 'nej'
I access this worked very fine - but with MySQL ( and ASP) I just cant get
it right!!! I go crazy ....

My code looks like this :

strSQL="SELECT COUNT(Q1) AS Q1_nej FROM Tbl_evaluering " &_
"WHERE Q1 = 'NEJ' "
set RS = connection.Execute(strSQL)
antal_nej = RS("Q1_nej")
procent_nej = formatNumber((antal_nej),2)/antalrecords * 100

Hope ...praying for help ...Please ;-)
best wishes -Otto - Copenhagen

 

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

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