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 6097399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:02:19+00:00 2026-05-23T13:02:19+00:00

I have 2 different columns in 2 tables, one is with Money datatype in

  • 0

I have 2 different columns in 2 tables, one is with Money datatype in table1 and another one with Decimal(13,4) in table2.I need to sum values in table2 and compare it with value in table1(HAmount).
However i found values like below, please suggest how to compare this.

Table1
HAmount
120.4500

Table2
DAmount
60.2285 
60.2200

IF(HAmount=SUM(DAmount))
BEGIN
    Success
END
ELSE
    Failed
  • 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-05-23T13:02:20+00:00Added an answer on May 23, 2026 at 1:02 pm

    Just convert everything to DECIMAL (13,2):

    IF(CAST(HAmount as DECIMAL(13,2) = SUM(CAST(DAmount as DECIMAL(13,2)))

    With default rounding settings this should give you the desired output without having to factor in “behind-the-scenes” decimals that aren’t displayed.

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

Sidebar

Related Questions

I have 5 tables. One primary and 4 additional (they have different columns). objects
I have to compare columns of tables located in two different databases in two
I have a ReferenceID varchar(6) column in over 80 different tables. I need to
I have several different tables, but they all have 2 columns that are the
I have two tables one named Person , which contains columns ID and Name
I have 4 tables (Type01, Type02, Type03, Type04) . They have different columns .
I have a set of tables with different data type for the columns and
I have two tables with one identical column name, but different data. I want
I have two tables and their only difference is one column is missing from
I have a table withe different columns as shown below Ref Number Service Numbers

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.