A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Combinning two table fields to one?



 
 
Thread Tools Display Modes
  #1  
Old November 11th, 2005, 12:27 AM
SharonInGa
external usenet poster
 
Posts: n/a
Default Combinning two table fields to one?

Trucks deliver merchandise to our warehouse. We need to track the date and
the boxes that were delivered by this truck. The same truck makes several
deliveries so it's ID# cannot be used as a unique number. The truck ID and
the date combined, however, can be used as a unique number.

Is there a way to combine the Truck ID# and date to make a unique key field
for the Delivery table? I can combine these values for forms, queries and
reports. If this can't be done, what suggestions do you have for creating a
unique number or should I just set the key field to autonumber?


  #2  
Old November 11th, 2005, 12:35 AM
Rick Brandt
external usenet poster
 
Posts: n/a
Default Combinning two table fields to one?

SharonInGa wrote:
Trucks deliver merchandise to our warehouse. We need to track the
date and the boxes that were delivered by this truck. The same truck
makes several deliveries so it's ID# cannot be used as a unique
number. The truck ID and the date combined, however, can be used as
a unique number.

Is there a way to combine the Truck ID# and date to make a unique key
field for the Delivery table? I can combine these values for forms,
queries and reports. If this can't be done, what suggestions do you
have for creating a unique number or should I just set the key field
to autonumber?


A primary key (or index) can contain as many as 10 fields. No need to combine
them into a single field.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


  #3  
Old November 11th, 2005, 07:15 AM
Bruce Rusk
external usenet poster
 
Posts: n/a
Default Combinning two table fields to one?

Yes BUT what if, one day, the same truck makes two deliveries? That may not
be a possibility now, but what if practices change and it happens some time
in the future? Creating a separate, unique number would preclude such
problems.

"Rick Brandt" wrote in message
om...
SharonInGa wrote:
Trucks deliver merchandise to our warehouse. We need to track the
date and the boxes that were delivered by this truck. The same truck
makes several deliveries so it's ID# cannot be used as a unique
number. The truck ID and the date combined, however, can be used as
a unique number.

Is there a way to combine the Truck ID# and date to make a unique key
field for the Delivery table? I can combine these values for forms,
queries and reports. If this can't be done, what suggestions do you
have for creating a unique number or should I just set the key field
to autonumber?


A primary key (or index) can contain as many as 10 fields. No need to
combine them into a single field.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com



  #4  
Old November 11th, 2005, 12:32 PM
Rick Brandt
external usenet poster
 
Posts: n/a
Default Combinning two table fields to one?

Bruce Rusk wrote:
Yes BUT what if, one day, the same truck makes two deliveries? That
may not be a possibility now, but what if practices change and it
happens some time in the future? Creating a separate, unique number
would preclude such problems.


What I said was that you build one primary key that consists of both the truck
ID field and the delivery time field. There is no requirement that the key
consist of only one field.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


  #5  
Old November 15th, 2005, 11:45 PM
StephanieGates
external usenet poster
 
Posts: n/a
Default Combinning two table fields to one?

27-2005-1111-01
27-2005-1111-02

Truck number 27
Date 2005-11-11
delivery # 1
delivery # 2
and so on.........
And call it truckdeliveryid or something like that

"Rick Brandt" wrote:

Bruce Rusk wrote:
Yes BUT what if, one day, the same truck makes two deliveries? That
may not be a possibility now, but what if practices change and it
happens some time in the future? Creating a separate, unique number
would preclude such problems.


What I said was that you build one primary key that consists of both the truck
ID field and the delivery time field. There is no requirement that the key
consist of only one field.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Table design problem? Melissa Database Design 29 November 18th, 2005 04:14 AM
Design help, please SillySally Using Forms 27 March 6th, 2005 04:11 AM
Here's a shocker Mike Labosh General Discussion 2 October 26th, 2004 05:04 PM
Complicated Databse w/many relationships Søren Database Design 7 July 13th, 2004 05:41 AM
COMPARE THE TWO TABLES Stefanie General Discussion 0 June 4th, 2004 04:36 PM


All times are GMT +1. The time now is 02:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.