473,387 Members | 1,540 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,387 software developers and data experts.

Pulling User Defined Field Values from Multiple tables.

Hi,

I have database with monthly sales data tables within it.

These sales data tables are organised as follows.
Expand|Select|Wrap|Line Numbers
  1. Item code; Description; Country1; Country2; Country3..etc
  2. 1234; Item1; Sales Value; Sales Value; Sales Value ..etc
  3.  
I have a union query that provides a full list of all the Item Codes, but also wanted to be able to query the sales values for those items by month for user defined countries.

for example my "ideal" output would look like the following
Expand|Select|Wrap|Line Numbers
  1. Item Code; Description; Month1; Month2; Month3.. etc 
  2.  
where the month relates to the same country across all relvent tables.
May 22 '08 #1
2 1332
Stewart Ross
2,545 Expert Mod 2GB
Hi. Your tables are not in any way in normalised form - there are repeating groups for countries and sales in each table. You will not be able to do any useful data analysis unless you resolve your design into a normalised form, removing all repeating groups into discrete tables and being careful to define attributes (such as the date of a sale) in such a way that you don't end up with multiple columns in the resultant tables.

There is a HowTo article on Database Normalisation and Table Structures linked here.

I can only stress that you really cannot make any progress until you have a design which is suitable - and what you have at present is not even in what is known as First Normal Form.

Scrap it and start again - it will save you a lot of work in the long run.

-Stewart
May 22 '08 #2
Not the ideal answer i was hoping for (lots more work for me to do), but the link you provided explains it all perfectly.

Thanks
May 23 '08 #3

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

Similar topics

3
by: Kunle Odutola | last post by:
I have a database that tracks players for children's sports clubs. I have included representative DDL for this database at the end of this post. A single instance of this database supports...
2
by: shivprasad koirala | last post by:
hi all(happy raksha bandhan day) we have one of Automation software for sales running for a customer.He was cool for the first month of product, but later popped with adding some extra...
7
by: Rick Caborn | last post by:
Does anyone know of a way to execute sql code from a dynamically built text field? Before beginning, let me state that I know this db architecture is built solely for frustration and I hope to...
5
by: Ed Havelaar | last post by:
I have a cool function that I want to use as a default value for a column in my table. But I can't because apparently Access doesn't allow user defined functions in expressions for default values....
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
15
by: Deano | last post by:
I've posted about this subject before but haven't really got anywhere yet. I have now come up with a plan of action that takes into account my strong desire to implement save/discard functionality...
1
by: cancer2006 | last post by:
I have to correct the ID field in 19 tables and there are 265 records affected in just one table . The id field is populated on the values from EInfo.ID, and EInfo.ID is based on the values from...
1
by: AndiSmith | last post by:
Hi guys, I wondered if anyone could help me with this problem, or even shed some light on the direction I need to take to resolve it? I'm using .NET 2.0 (C# flavor) to build a large user-based...
3
by: klbachrodt | last post by:
Hi all - I've been browsing this forum for a while now, looking for help, and finally decided to join and ask my question, since I'm not terribly good at writing SQL queries in Access. Here is my...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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: 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
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...

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.