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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:57:02+00:00 2026-05-28T05:57:02+00:00

Below is my syntax. Im trying to only return the rows where assg.Hours_Act <>

  • 0

Below is my syntax. Im trying to only return the rows where assg.Hours_Act <> Sum(assh.HourEntry) for a specific callID’s HeatSeq.

In my having statement below you can see how I am attempting this, but no conversion that I’ve tried thus far has worked.

SELECT assg.CallID, assg.HEATSeq, assg.Hours_Act, SUM(assh.HourEntry) AS HourSum
FROM Heat.Dbo.asgnmnt AS assg
INNER JOIN heat.dbo.Assignment_Hours AS assh
ON assg.CallID = assh.CallID AND assg.HEATSeq = assh.HEATSeq
WHERE assg.Hours_Act IS NOT NULL
GROUP BY assg.callid, assg.HEATSeq, assg.Hours_Act
HAVING assg.Hours_Act <> CONVERT(VARCHAR(10),SUM(assh.HourEntry))

The issue is the precision of the SUM is creating a different value than what is in Hours_Act.
The assg.Hours_Act is a VARCHAR and the Sum(assh.HourEntry) returns a DECIMAL

Below is a screenshot of my results where you can see the issue:
enter image description here

EDIT: Final Working code:

SELECT assg.CallID, assg.HEATSeq, assg.Hours_Act, SUM(assh.HourEntry) AS HourSum
FROM Heat.Dbo.asgnmnt AS assg
INNER JOIN heat.dbo.Assignment_Hours AS assh
ON assg.CallID = assh.CallID AND assg.HEATSeq = assh.HEATSeq
WHERE assg.Hours_Act IS NOT NULL AND ISNUMERIC(assg.Hours_Act) = 1
GROUP BY assg.callid, assg.HEATSeq, assg.Hours_Act
HAVING CONVERT(DECIMAL(10,2), assg.Hours_Act) <> CONVERT(DECIMAL(10,2), SUM(assh.HourEntry))
  • 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-28T05:57:02+00:00Added an answer on May 28, 2026 at 5:57 am

    @antisanity is correct. You can also try filtering out any rows where the assg.Hours_Act is not a numeric value. If you have any bad data stored, this could be causing the conversion issue. Just add to your WHERE clause:

    AND ISNUMERIC(assg.Hours_Act) = 1
    

    Alternately, you could just select on the source data where ISNUMERIC = 0 to see if you have any bad data that needs cleaned.

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

Sidebar

Related Questions

I'm trying to get a match but am having trouble with the syntax, below
i am trying to do as below its giving syntax error please help DELETE
I'm getting the following error on the line of code below: Syntax error (missing
Can someone explain me the syntax below line 1? I am OK with js
Does anybody know how to do this syntax below in mysql? Without Stored Procedure,
Below code saying error incorreect syntax near Main INSERT INTO tbl ( 'Week', Main,
what is the name and syntax of the construction ((..)) in example below? for
I want to create one proc like below but it has error on syntax.
Some batch files on Windows use an IF syntax with multiple lines, as below:
See the chart below. I'm building the chart programatically, so no asp.net control syntax

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.