PDA

View Full Version : Query based on values in one table



sai_golden
06-07-2007, 07:57 AM
Hi,

I have a table with customers data. I want to make a query to filter out values and upload it in different table.

Example : I have a table for sales which contain various fields like name address and country.

I need a solution like : to find all transactions for country Say England and i want to update the same in a table say England table.

Is there any query to do this? or VBA code ?

Please help me in finding a solution to the above.

:help

:hi:

Oorang
06-07-2007, 09:19 AM
That is called a "Make Table Query" you can build them via the interface by changing the Query Type to "Make Table" Here is some example SQL on how to do:

SELECT AB_AWW_Data.* INTO AB_AWW_Data
FROM AB_AWW_Data
WHERE AB_AWW_Data.ST="OH";

mattj
06-07-2007, 09:55 AM
From what you have posted, it sounds as if you may end up with a table for each country. If you can create a query that displays the information, there is almost no reason why you need to create a separate table. If this is what you are trying to do, I strongly suggest that you don't. Are you familiar with the concepts of normalization?

Normalization Links:
http://www.datamodel.org/NormalizationRules.html#one
http://support.microsoft.com/kb/283878

Oorang
06-07-2007, 12:36 PM
Good point Matt,
Sai you may find this article helpful. http://en.wikipedia.org/wiki/Database_normalization It's recommended that you at least use Third Normal Form (3nf) unless there is a compelling reason not to.

It is worth noting that on low performance databases such as Access sometimes DEnormalizing is desirable to achieve speed, especially on a slow network. (I know, I know, I speak blasphemy.)

geekgirlau
06-07-2007, 09:46 PM
Sai, I'd recommend you get hold of a book called "Database Design for Mere Mortals" (the name of the author escapes me at the moment). It talks about designing databases in a way that makes it simple to understand (even for novices). It is not specific to any application (such as Access), but talks about creating a functional database structure.

sai_golden
06-08-2007, 06:29 PM
Hi,

Thanks for your replies.

Oorang and Mat I have just gone thru the concepts of normalisation in the link provided by you. Proved to be very useful.

Thanks a lot!!!!!!!!!!!:clap: :bow: :clap: