TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Lynn Emery
NA
47
56.3k
Divide By zero Error
Mar 5 2013 4:53 AM
Hi i am trying to do the following calculation but I get an error satating 'divide by error encountered'
SELECT Customer1, QtyRefunded, Year, Month, QtySales, CAST(SUM(QtyRefunded) * 1000000 / SUM(QtySales) AS DECIMAL(9, 2)) AS PPM
FROM dbo.[Refunds&ShippedJoin]
GROUP BY Customer1, QtyRefunded, Year, Month, QtySales
I pressume it is becuase I am dividing a number by 0, however I don't know how to ressolve this error.
Thank you for your help in advance.
Reply
Answers (
1
)
Prevent Concurrent execution of Stored Procedure
How to update multiple tables in sql server 2008 ?