473,387 Members | 1,456 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.

Changing Database Format. Possible SQL Query?

I am trying to change the database I've built a little bit, so it would be easier to add more unit's if we need to. Currently the table design is set up as below

Part Number--|--Part Name--|--Unit1ECD--|--Unit2ECD--|--Unit3ECD--|--etc.
----Part A-------|-----Name A---|----9/9/99-----|----9/9/99-----|----9/9/99------|--etc.
----Part B-------|-----Name B---|----9/9/99-----|----9/9/99-----|----9/9/99------|--etc.
----Part C-------|-----Name C---|----9/9/99-----|----9/9/99-----|----9/9/99------|--etc.

With it set up like this I can set up a form that let's people go in, and status all the unit's at one time, however if i have to add in more unit's, I have to go in, and add 5 to 6 columns for each unit.

I would like to set it up like the example below, but still be able to set up a form that looks like the format above

Part Number--|--Part Name--|--ECD--|--Unit--|--ect.
----Part A-------|-----Name A---| 9/9/99 |----1----|--etc.
----Part A-------|-----Name A---| 9/9/99 |----2----|--etc.
----Part A-------|-----Name A---| 9/9/99 |----3----|--etc.
----Part B-------|-----Name B---| 9/9/99 |----1----|--etc.
----Part B-------|-----Name B---| 9/9/99 |----2----|--etc.
----Part B-------|-----Name B---| 9/9/99 |----3----|--etc.
----Part C-------|-----Name C---| 9/9/99 |----1----|--etc.
----Part C-------|-----Name C---| 9/9/99 |----2----|--etc.
----Part C-------|-----Name C---| 9/9/99 |----3----|--etc.


I've tried to set up some crosstab query's, but you can't update the data in a crosstab query. Is there an SQL query or something of that nature that I would be able to create that would allow updates?

If this doesn't make sense, just let me know :-P
Mar 25 '08 #1
1 1024
Stewart Ross
2,545 Expert Mod 2GB
Hi. It is clear from what you have posted that your database is not relationally designed, as there are two different objects (the parts and the units) and repeating groups of data (the units) which would be separated into their own tables had the database been appropriately designed. The format shown is more like an Excel table.

It is impossible to resolve your 'adding units' issues as it stands; the tables are not yet in what is known as First Normal Form (the first of three database decompositions which separate out different objects into different tables).

The following article from the HowTo section of the forum may help:
Database Normalisation and Table Structures

-Stewart
Mar 26 '08 #2

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

Similar topics

8
by: Rob | last post by:
Hi all, Is it possible to change the Session.LCID in a hyperlink? My problem is I'm calling a Date from a database to use as a querystring in the hyperlink but I also need to display the date as...
5
by: Muhd | last post by:
Hey all, I have a basic table that looks something like this. CREATE TABLE MyTable ( ID INT IDENTITY PRIMARY KEY, Company_ID INT NOT NULL, Round VARCHAR(50) NOT NULL, Details VARCHAR(250)...
7
by: Phin | last post by:
I need your HELP! I've seen all the posts on using Crystal Reports within vs.net (vb.net) and changing a SQL query at runtime. When I tried to pass in a dataset into the crystal report at...
10
by: Marizel | last post by:
I'm not sure there's an easy solution to this, but thought I'd ask. I often find myself with a query which I'd like to reuse, but with a different datasource. These datasources generally have...
32
by: deko | last post by:
I have a popup form with a textbox that is bound to a memo field. I've been warned about memo fields so I'm wondering if I should use this code. Is there any risk with changing the form's...
4
by: onecorp | last post by:
I have a SQL table comprised of 31 columns. The first column is simply an id column, the next 30 columns are labelled ,.... The numerical columns have a tinyint type and the data stored is either...
1
Curtis Rutland
by: Curtis Rutland | last post by:
How To Use A Database In Your Program Part II This article is intended to extend Frinny’s excellent article: How to Use a Database in Your Program. Frinny’s article defines the basic concepts...
3
by: inglesp | last post by:
Hi everyone I've come across some perculiar behaviour in a little database app I'm making with Access. I have a form for users to create a filter for data that goes into a cross-tab query. One...
7
by: franc sutherland | last post by:
Hi everyone, I am using Access 2003. I have a database with a table in it which is linked to an excel spreadsheet. When I install the database on someone else's system, the pathname to the...
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: 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
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?
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
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
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...

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.