Learn how to a build a cloud-first strategyRegister Now


Incorrect Syntax for SUM

Posted on 2005-05-16
Medium Priority
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

Accepted Solution

XPIMatthias earned 375 total points
ID: 14009189

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

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

810 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