joining field into multiple fields

Results 1 to 3 of 3

Thread: joining field into multiple fields

  1. #1
    Chris M Guest

    Default joining field into multiple fields

    Let's say you have a table with seven fields, one for each day of the week, and another table with one field called "TV program". Each day of the week has a different TV program in it, so I want to create a join table that puts the TV program field from the one table into each of the weekday fields in the other table. When printing info out with ASP, how do I specify which day of the week field I want the "TV program" field from? If I simply response.write variable("TV program"), the ASP doesn't know which I want--the "TV program" joined into the Monday field, the Tuesday field, etc?

  2. #2
    Join Date
    Dec 1969

    Default RE: joining field into multiple fields

    You may want to read up on db normalization. The best way would be to have the day of the week associated with the TV program using a number. For example Wed would be 4. A field in the prgrams db called "day" would have a 4 in it, or for that matter any days which the program airs on. then when you display the data your columns would be laid out so that each day shows the programs that air. Use a separate table for the days of the week and then you can join.<BR><BR>Hope that helps.

  3. #3
    Chris M Guest

    Default RE: joining field into multiple fields

    Doug, will read on db normalization but in the mean time... I&#039;m not sure I understand what you mean. Right now there is a primary key field in the "TV program" table which is associated with foreign key fields in the "weekday" table (whose recordsets are viewing patterns--Bob&#039;s weekly viewing, Mary&#039;s weekly viewing, etc). Are you saying I should have a weekday field associated with a primary key and then have a bunch of foreign keys associated with the TV programs? That seems backwards to me?<BR><BR>Or when you refer to "Wed would be 4" are you saying something else?<BR><BR>Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts