Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8690789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:58:42+00:00 2026-06-12T23:58:42+00:00

In SQL Server 2008, I am running a report where I need to divide

  • 0

In SQL Server 2008, I am running a report where I need to divide two columns (called Completes and Prescreens, whole integers), and then I go to Excel and get the Prescreens divided by the Completes, and turn that into a number with 2 decimal places, then convert that to a percentage. i.e. -> 0.34, then becomes 34%.

In SQL in know I probably can’t get the output as “34%” but at least I’d like it as 0.34 . So far I have:

cast((sq.Completes/sq.Screens ) as float ) as 'conv'

Completes are the smaller of numbers(usually 27, 38, etc), and Screens are bigger numbers(124, 276, etc.)

But this is outputting my column as all 0s . How do I make it show 0.34 , 0.84, etc

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:58:43+00:00Added an answer on June 12, 2026 at 11:58 pm

    Try it like this:

    select (cast(sq.Completes as float)/cast(sq.Screens as float)) as 'conv'
    

    You can also do this to round the value:

    select round((cast(sq.Completes as float)/cast(sq.Screens as float)),2) as 'conv'
    

    And finally, this to show it visually as a percentage:

    select cast(round((cast(sq.Completes as float) /
       cast(sq.Screens as float)),2) * 100 as varchar(25)) 
       + '%' as 'conv'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQL Server 2008 R2 Report Server running on a Windows 7
Running SQL Server 2008 (not R2). I have a few reports that have URLs
Over the weekend the SQL Server 2008 R2 (running on Windows Server 2008 R2)
Please help this beginner here... I have a SQL Server 2008 R2 running on
My work is running SQL Server 2008 and I spend a lot of time
I am running windows server with asp.net websites and sql server 2008 and IIS
I've just upgraded an existing SQL Server 2005 to 2008 by running the installer
How can I see opened connections /running queries in SQL Server 2008?
We have a single computer with Windows7 Home Premium running with SQL Server 2008
Running JBoss 5.1, with Hibernate as the JPA provider. Backed with SQL Server 2008.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.