473,473 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to sum quantities for each kind of part number and display ?

I have two tables one table has part number and qty columns the second table has part number and cell that is which cell the part number belongs to. I have to display each unique part number and the sum of quantity ordered. Also display 0 quantity for part numbers that have never been ordered. The cell name is V3 and the part number is a text column so I can't match it with the quantity column. Please help me with this query
Nov 4 '10 #1
1 1824
NeoPa
32,556 Recognized Expert Moderator MVP
This question is not clear. You need to take more care that your question makes sense. I will do what I can, but if you need more you will need to provide decent information.

Try :

Expand|Select|Wrap|Line Numbers
  1. SELECT   t2.V3 AS [Cell]
  2.        , t2.PartNo
  3.        , Nz(Sum(t2.[Qty]), 0) As SumQty
  4. FROM     [Table2] AS t2
  5.          LEFT JOIN
  6.          [Table1] AS t1
  7.   ON     t1.PartNo = t2.PartNo
  8. GROUP BY t2.V3
  9.          t2.PartNo
Nov 4 '10 #2

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

Similar topics

1
by: Larry Rekow | last post by:
ve built various web apps using Frontpage and/or ASP and Access, but now I'm trying to figure a way to do the following: My friend gets parts lists in invoices (they are in an excel spreadsheet)...
2
by: JumpinJeff | last post by:
I am about to revamp the most referenced table in my whole database and am unsure the best way to approch it. The table's primary key is also used as a part number for all the items in the table. ...
3
by: Larry Rekow | last post by:
I've built various web apps using Frontpage and/or ASP and Access, but now I'm trying to figure a way to do the following, perhaps in ASP.Net My friend gets parts lists in invoices (they are in...
3
by: dave | last post by:
Hello I would like to display the Version number of my application in the About screen. I manually set this value in the Properties of my deployment project. How can this value be accessed at...
1
by: philip | last post by:
hello, i am confused about the following aspx page, when the Submit button is clicked, the page will append a number to Label1, but i am wondering why the first row displays twice, would u please...
1
by: Mangler | last post by:
I dont know if this is possible or if someone has a better way to do this but here it is: I have a page where the user enters an rma#, lot#, and number of barcodes they need to print, here is...
1
by: Mitul | last post by:
Hello Friends, I am working on a project which use PHP5.0, My-SQL 5.0, Smarty. Now I am stuck at a point to display foreach itration like below. as Ioop will continue I want to display loop...
4
by: rousseaud | last post by:
I’m trying to generate a part number of sort. It must be a total of 11 characters and have two “sections” separated by the letter ‘P’. The first section is a number I select from a combo box and...
1
by: tbrogdon | last post by:
I am new to this group and new to DBs. I am building a small DB for my work. We create sheetmetal parts. Each part has a part number (e.g., 1054471 or 50TG508506 - both formats are typical for a...
4
by: Suprim | last post by:
Hi...I want to get the different random number for each time when the application is run. For example : When i run the application, if i got 3 as the random number for the first time then when i...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.