Incorrect Syntax for SUM

Posted on 2005-05-16
Last Modified: 2010-03-19
I have the following query below, written in access, I need to convert it to sql

SELECT dbo_job.jobid, Sum([workitem.quantity]*[templateprice.price]) AS [value]

I have as follows

SUM(dbo.workitem.quantity * dbo.templateprice.price) AS [Value]

However I am getting different values than the access statement

Is there an error in the syntax


Question by:polynominal
    1 Comment
    LVL 1

    Accepted Solution


    syntax is ok,

    effect stems from different data formats (column types) and their calculation logic. Check if the column types have the same precision on access and on sql.


    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
    Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
    Via a live example, show how to setup several different housekeeping processes for a SQL Server.
    Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now