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

  • SEARCH
  • Home
  • 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 8773929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:25:57+00:00 2026-06-13T18:25:57+00:00

I am using the following to create a comma formatted number in T-SQL. How

  • 0

I am using the following to create a comma formatted number in T-SQL. How can I get rid of the decimal point and the digits after decimal. So if I get 1,112.00 after formatting, how would I get only 1,112?

SELECT CONVERT(varchar, CAST(1112 AS money), 1)
  • 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-13T18:25:59+00:00Added an answer on June 13, 2026 at 6:25 pm
    DECLARE @val varchar(50)
    
    set @val = CONVERT(varchar(50), CAST(1112 AS money), 1)
    SELECT  left(@val, len(@val) - 3)
    

    This also works with digits after the decimal point:

    DECLARE @val varchar(50)
    
    set @val = CONVERT(varchar(50), CAST(1112.56 AS money), 1)
    SELECT  left(@val, len(@val) - 3)
    

    Note: as @Mahmoud Gamal points out, formatting is often more suited to be performed in the front-end.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using following code to create new wifi access point and to connect
Currently I do the following: Create package using msbuild something.csproj /P:Configuration:Some /T:Package After that
I want to do the following using SQL Server 2005. Create a stored procedure
I'using the following code to create thumbnails using ffmpeg but it was working fine
So I'm using the following CSS to create a button style; .button { display:
I'm using the following code to create an audit trail in an MVC3 app.
I've been using the following approach to create components and return values from Swing
I've been using the following code to create various struct, but only give people
I am using the following css to create list items with a chckerboard background
I am using the following function to create a simple accordion. The problem is

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.