473,583 Members | 4,428 Online
Bytes | Software Development & Data Engineering Community
+ 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 1829
NeoPa
32,566 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
1517
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) that he has to classify as a certain type: eg. part number 111-111-111 is type R9, and part 222-222-222 is type 486, etc. we have a database...
2
1963
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. My first problem is that I need to seperate the single part number field into multiple (3 or more). I could make multiple primary key's for each...
3
1065
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 an excel spreadsheet) that he has to classify as a certain type: eg. part number 111-111-111 is type R9, and part 222-222-222 is type 486, etc. ...
3
1735
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 runtime? Thanks for any help!
1
1183
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 tell me? how can i solve this problem? thanks. number: 0 number: 0 <--- why display twice number: 1 number: 2 number: 3
1
1583
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 the code for the results page that shows the barcodes to print: <%
1
1424
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 step in following format. 1st, 2nd, 3rd, 4th....etc.... Please help me for this. Any Solution will be welcome.
4
2172
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 can consist of 1 to 6 characters in length. The second section must be a unique incremental number starting from 1 that will have leading zeros to make...
1
1806
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 part number). Any given part may have a number of operatons involved in it's production. Each operation process has its own allotted code: shear -...
4
1316
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 close and open the application again i want to get number expect than 3 as the first number...If anyone can than please help me ..it's really urgent..
0
7894
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8323
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7933
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8191
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6578
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5700
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5372
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3816
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1155
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.