Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2015
    Posts
    3

    Unanswered: Enter parameter value

    Hi guys,

    I want to make a report for a database I have and I want it to show a percentage. Its a simple table with only 2 fields, where I want the percentage to be the amount of fields opposed to the total.
    Here is the query

    SELECT genre_name,(COUNT(genre_name)*100/(SELECT COUNT(*) FROM dbo_Movie_Genre)) As percentage
    FROM dbo_Movie_genre
    GROUP BY genre_name
    ORDER BY percentage DESC;

    Now this gives me the error: "enter parameter value" for percentage. Ive looked it up but its all kinda blurry to me.

    Thanks!

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    I would have written:
    Code:
    SELECT genre_name
          ,(COUNT(genre_name)*100) / COUNT(*) As percentage
      FROM dbo_Movie_Genre;
    Have a nice day!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •