473,395 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Sum the total Defects

Hello Everybody,

How can I combine then compute the sum of totalDefects of this 2 Select statement in one Select Statement

Select sum(nDefects) Defects
from tbl_ProcessDefects
where vcLotNo ='11' and iDefectId = '0'
Defects = 5


Select sum(nDefects) Defects
from tbl_ProcessDefects
where vcLotNo ='3' and iDefectId = '0'
Defects = NUll meaning 0

When I get the total, should be 5..i also tried this

Select sum(nDefects) Defects
from tbl_ProcessDefects
where vcLotNo ='11' and and vcLotNo = '0'i DefectId = '0'

The Out is now Null instead of 5.

Thanks
Apr 23 '07 #1
1 1154
ronverdonk
4,258 Expert 4TB
Select sum(nDefects) Defects
from tbl_ProcessDefects
where vcLotNo ='11' and and vcLotNo = '0'i DefectId = '0'
That is an impossible clause. You cannot have a field having a value '11' and '0' at the same time!! So probably your statement should be
Expand|Select|Wrap|Line Numbers
  1. SELECT SUM(nDefects) as Defects
  2.     FROM tbl_ProcessDefects 
  3.     WHERE (vcLotNo ='11' OR vcLotNo = '0') AND iDefectId = '0' 
Next time put your code statements within code tags, so it is better readable!

Ronald :cool:
Apr 25 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Dathan Vance Pattishall | last post by:
------=_NextPart_000_0110_01C3671D.228BB6C0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I've notice that when grown defects (bad blocks on the disk caused by...
1
by: beavenour | last post by:
I am looking for some help creating a more universal function out of this lame attempt at javascript. I have little experience with javascript and want to be able to universalize this function. ...
10
by: giancarlodirisioster | last post by:
Can someone help me modify this for future Usenet archival and to help me solve what I don't know? <form name="addform" method="POST" action="./submit.php"> <input type="text" name="Box 1"...
2
by: worli | last post by:
Hi All, I have a strange requirement. I have a dynamic input numeric data stream e.g. 2, 2, 4, 5 etc.... ( each input number range from 1 to 10 ). lets take a simple case where all inputs will...
4
by: Rich_C | last post by:
I'm sure this is very simple, but I have very little experience with javascript -- and what I do know isn't helping me here. I have a simple form where users can enter a quantity (qty) and cost...
1
by: CaptainDahlin | last post by:
I know the basics about access reports and putting page totals in the page footers. What I can't figure out is along with the current page total to display the previous page total: At the bottom...
62
by: Born | last post by:
GC is really garbage itself Reason 1: There is delay between the wanted destruction and the actual destruction.
2
by: sammiesue | last post by:
Hi, I have form with 2 autosummed textboxes ("total" and "casinototal"). I would like to have a grand total textbox ("grandtotal") get its value from summing "total" and "casinototal", but it...
21
beacon
by: beacon | last post by:
Hello to everybody, I have a section on a form that has 10 questions, numbered 1-10, with 3 option buttons per question. Each of the option buttons have the same response (Yes, No, Don't know),...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.