473,397 Members | 2,116 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,397 software developers and data experts.

add values for different products and get their total amount

I would like to add values for different products and get the total value in Ma access.
e.g

PRODUCT_NAME UNIT_PRICE QUONTITY
Fanta 100 10
Cock 80 5
Pepsi 70 15

Now How do i get total for the three comodities and represent the expression in a field in ms access querry or form?

Thanks,

Regards,
Gerald.
Feb 28 '14 #1
3 1067
mcupito
294 256MB
If you're trying to get a sum of a specific field, it would be something like this (for "Quontity") but are just trying to Sum each row?

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT e.ProductName, e.UnitPrice,e.UnitQuontity,
  3. (SELECT 
  4.  SUM(y.Quontity)
  5.                 From YourTable AS y)  AS SumAmt
  6. FROM YourTable AS e
  7.  
  8.  
Feb 28 '14 #2
NeoPa
32,556 Expert Mod 16PB
The SQL subquery approach illustrated by Mark is an answer for getting the value into a query when you also want to see all the determining records. If only the total is required then a simpler aggregate query is all that's required (No subquery).

In a form or report though, you can total using the Sum() function. This is possible anywhere, but is usually handled in the Form or Report footer sections.
Mar 1 '14 #3
mcupito
294 256MB
Thanks for clearing that up for me, NeoPa. I wish the OPs would return often enough and provide more clarity or let us know if our solution worked xP.
Mar 2 '14 #4

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

Similar topics

1
by: Jeroen van vliet | last post by:
Hello, im using visual basic 6.0 and i made an form where to insert names,street and an amount of money into an access database. Well every time when i insert an amount of money, the amount has...
3
by: Otto | last post by:
Hi I'm migrating from Access til MySQL. Works fine so far - but one thing is nearly killing me: I got the count of total records in a variabel - (antalRecords) I got the count for the Field Q1...
9
by: mankolele | last post by:
Hi all I need an idea on where to start when calculating a total amount betwee n two dates from a database like I want amount of money paid out from 30/03/2004 and 30/07/2004 ,but in the database...
5
stonward
by: stonward | last post by:
Help! I have a database with a large number of (very similar) products - tyres - but in addition I need to add other completely dissimilar products/services. At the moment I have a table for Tyres...
4
by: sdjanibasha | last post by:
hi i have a table as ONUM AMT ODATE CNUM SNUM 3001 18.69 03-OCT-94 2008 1007 3003 767.19 03-OCT-94 2001 ...
2
by: Serenityquinn15 | last post by:
Hi! I have little trouble in my Program. I need to total all the amount in specific column.. comes from the data produced by the datagrid.. heres my code: Set rs11 = New Recordset...
4
by: kaavitha | last post by:
I am using checkbox list in my project, item1 250 item2 200 item3 300 item4 250 item5 300 so after checking ,the selected items should be redirected to another page with their cost and the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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...
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
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...

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.