Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old January 1st, 2006, 11:45 PM
graycam@gmail.com
Guest
 
Posts: n/a
Default How do you record multiple values into a column??

E.G. I want to record sales.
Three tables - TblProduct TblCust & TblSales

TblCust fields = custID custName
TblProducts fields = prodID prodName
TblSales fields = salesID custID prodID

If Bob (cust ID 555) buys prodID 4 and prodID 5, how can I record this
in TblSales? Can I record both item 4 and 5 in a single field?

EG
salesID = 100
custID = 555
prodID = 4 & 5

or would I need:
salesID = 100
custID = 555
prodID1 = 0
prodID2 = 0
prodID3 = 0
prodID4 = 1
prodID5 = 1

What's the normal way to do this?

Thanks!
Cam

  #2  
Old January 1st, 2006, 11:55 PM
Rick Brandt
Guest
 
Posts: n/a
Default Re: How do you record multiple values into a column??

graycam@gmail.com wrote:[color=blue]
> E.G. I want to record sales.
> Three tables - TblProduct TblCust & TblSales
>
> TblCust fields = custID custName
> TblProducts fields = prodID prodName
> TblSales fields = salesID custID prodID
>
> If Bob (cust ID 555) buys prodID 4 and prodID 5, how can I record this
> in TblSales? Can I record both item 4 and 5 in a single field?
>
> EG
> salesID = 100
> custID = 555
> prodID = 4 & 5
>
> or would I need:
> salesID = 100
> custID = 555
> prodID1 = 0
> prodID2 = 0
> prodID3 = 0
> prodID4 = 1
> prodID5 = 1
>
> What's the normal way to do this?[/color]

The normal way is to have an additional table for the items on each sale.

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


  #3  
Old January 3rd, 2006, 12:05 AM
lesperancer@natpro.com
Guest
 
Posts: n/a
Default Re: How do you record multiple values into a column??

you need
tblSales
salesId
custId

tblSalesDetail
salesId
prodId

to allow for many products for one sales order

graycam@gmail.com wrote:[color=blue]
> E.G. I want to record sales.
> Three tables - TblProduct TblCust & TblSales
>
> TblCust fields = custID custName
> TblProducts fields = prodID prodName
> TblSales fields = salesID custID prodID
>
> If Bob (cust ID 555) buys prodID 4 and prodID 5, how can I record this
> in TblSales? Can I record both item 4 and 5 in a single field?
>
> EG
> salesID = 100
> custID = 555
> prodID = 4 & 5
>
> or would I need:
> salesID = 100
> custID = 555
> prodID1 = 0
> prodID2 = 0
> prodID3 = 0
> prodID4 = 1
> prodID5 = 1
>
> What's the normal way to do this?
>
> Thanks!
> Cam[/color]

 

Bookmarks

Thread Tools

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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles