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

Totals items from two databases

I have two tables in my databse

Table # 1 Item | PriceK | PriceM |Price H | Price T
This is populated with items and four prices, these prices are based on a group that the user belongs to(k,m,h, or t)
Table #2 Username | Group | Dec3 | Dec4 | Dec5 | Total
In Dec3 Dec4 etc will be an item that corresponds to the items in table#1.

I need to take the item in Dec3 and retrieve the price based on the group that the user is in and add it to the same for Dec4 and Dec5 and place that total in Table #2 Total.

I can do this by redoing the tables or by having several submits and using a seperate table , but Id rather it be done right. If you can help Id greatly appreciate it.
Nov 20 '07 #1
1 1128
Honestly table #1 (and possibly #2) should be redesigned a bit in my opinion. Something like this would be more beneficial for table #1:

Item | Price | Group

Then you could get the total a lot easier by joining the two tables on the item and group columns and then making a cross-tab selection from the result using your date columns. I'd be more helpful and provide an example of such a query, but I don't know what type of database you have.

A slight change to table #2 can futher simplify things:

Username | Group | Date | Total

This would make the cross-table selection unecessary as it could then be replaced by a group by clause using the Date column instead. Again, the syntax will be different based on the database in question or I'd provide an example.
Mar 17 '08 #2

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

Similar topics

2
by: Steve | last post by:
Hi, I have xml data containing "line item" elements and a "footer" element which contains control totals for the line items. While I can easily validate the control totals in xslt, I have not...
1
by: Maddman | last post by:
I'm in the process of converting an Access database into a SQL 2000 database using Access Project as a front end. Here's where I'm stuck. I've replaced the old access queries with user-defined...
6
by: KashMarsh | last post by:
Trying to show running totals on a report, except it needs to show one total amount and values being subtracted from it. For example, the report shows a Total Inventory amount (TotInvAmt). And...
2
by: | last post by:
I have gotten the following error in trying to get totals to come out on a footer. Server Error in '/test' Application....
3
by: mark | last post by:
im keeping running totals of certain columns in a datagrid, id like to put these totals in the footer - how do i do this ? or how can i put a label into the footer ? (im displaying results using...
10
by: rdemyan via AccessMonster.com | last post by:
I have a subform that displays around 10 fields. Most of the values shown result from some complex calculations. To make it easy, I have stored the results in a temporary table and then all I...
2
by: BerkshireGuy | last post by:
I have a form that acts like a dashboard to show summarized data. Currently, this form gets its summarized values from a total's query. When the user selects to run the dashboard, they should be...
5
prn
by: prn | last post by:
Hi folks, I'm looking for a little advice here. I need to create a report that is totals only, with no detail records. I have a database with a lot of individuals (people) and the report has to...
1
by: croxi | last post by:
Hello, I'm currently running Access 2007 in Spanish and VB8 in English. I need help regarding a problem I have with one of my Databases. What I have used is a MSoft Access 2007 template called...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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.