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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:29:33+00:00 2026-05-24T01:29:33+00:00

I keep having the same issue revolving a particular query which has the following

  • 0

I keep having the same issue revolving a particular query which has the following column:

CAST((COALESCE(price, 0.000000)) AS DECIMAL(18,6)) * quantity amount (TITLE 'Amount')

If I don’t mention it in the group by it spews error 3504, if I do it spews back error 3627.

Any idea on how to properly structure this part of the query?

edit: if you need more info, please ask away 🙂

  • 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-24T01:29:34+00:00Added an answer on May 24, 2026 at 1:29 am

    I believe you are experiencing multiple problems here (it’s hard to say without more code).

    The 3504 occurs when this column is not part of the GROUP BY clause because all columns that aren’t part of the GROUP BY must be “aggregate” functions (eg. SUM, MAX, MIN, AVG, etc). When you do include it in the GROUP BY, this column is now fine.

    However, my guess is that you also have a COUNT(DISTINCT(x)) in you SELECTion list. You can’t use the DISTINCT function in the SELECT, ORDER BY, or HAVING clause of a query when also using a GROUP BY. I suspect if you remove the DISTINCT, leaving you with COUNT(*), this will work.

    As an aside, I’m not sure you want to be grouping by the column you mention here. It’s unusual to group on a financial amount. It would be more common for this column to be aggregated with a SUM function for instance. Or otherwise you may want to reconsider why you’re using a GROUP BY (as grouping by the “amount” will give you odd results, essentially giving you one row for each row returned, except where the GROUP BY columns and the “amount” are the same, where it will collapse it down to a single row, meaning you will get inconsistent results).

    Hope this helps.

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

Sidebar

Related Questions

The problem that I am having has to do with the need to keep
I keep on having these same two problems. I have been trying to use
I keep running across this loading image http://georgia.ubuntuforums.com/images/misc/lightbox_progress.gif which seems to have entered into
I keep hearing from associates about grid computing which, from what I can gather,
I'm having an issue where I'm corrupted a PDF and not sure of a
I am having an issue with SSH hanging on my Mac Book Pro. This
Is it possible to use the FromStream method of System.Drawing.Image without having to keep
I keep having complaints that users are logged in as each other. They can
Keep in mind that I'm not looking for a list of current browsers to
I keep getting tasks that are above my skill level. How can I address this without coming accross as grossly incompetent?

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.