one-to-many - how to display data from two tables?

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default one-to-many - how to display data from two tables?

    Hi,
    I'm working with Access/VBScript/ASP.

    I have an events table that has:

    eventID
    venueID
    eventname

    ....I also have a venues table that has

    venueID
    venuename

    How do I create a recordset on a page, that will display the events, but
    will also display the venue name, by matching the venueID in the events
    table, with the venueID in the venues table?

    Got me stumped.

    Thanks.
    Nath.


    Nathon Jones Guest

  2. Similar Questions and Discussions

    1. display data points but not data tips
      does anyone know how to display the data point, but not the data tip? i just want to display the circular node that shows where the data point is,...
    2. How to display a set of data in a data grid when drivenby a combo box?
      I am trying to build a page where the user can select a syle of food (i.e. chinese, italian etc) from a combo. I would then want the relevent...
    3. find values in two tables, display results in one
      Is there a good way to do a search for date ranges in two different tables and have the results appear on the same screen/printout? Our Filemaker...
    4. Display data from database in a scrollable data grid on an ASP Page
      Hi All, I want to display data from database in a scrollable data grid on an ASP Page. I want to use it for entering data also. Should i have to...
    5. Inserting into one table data from 2 tables and some input data.
      Alrighty, I pull records from a database table onto a page based on vendor #. On this page I have an input box after each row of data that is just...
  3. #2

    Default Re: one-to-many - how to display data from two tables?

    select events.eventid, events.venueid, events, eventname, venue.venueid, venue.venuename
    from events, venues
    where events.venueid=venues.venueid
    greekchild Guest

  4. #3

    Default Re: one-to-many - how to display data from two tables?

    select events.eventid, events.venueid, events, eventname, venue.venueid, venue.venuename
    from events, venues
    where events.venueid=venues.venueid
    greekchild Guest

  5. #4

    Default Re: one-to-many - how to display data from two tables?

    Create a query in Access, it's got some wonderful wizards and tools for
    building queries.

    --
    Jules
    [url]http://www.charon.co.uk/charoncart[/url]
    Charon Cart 3
    Shopping Cart Extension for Dreamweaver MX/MX 2004


    Julian Roberts Guest

  6. #5

    Default Re: one-to-many - how to display data from two tables?

    Hi,

    Yup, I decided that I would do the query in Access rather than server side.

    Thanks for the advice though. One other thing...

    I have an events table which has the following

    eventID
    eventname

    ....I have an artists table that has the following:

    artistID
    artistname

    Some of the events have more than one artist appearing. Similarly, some of
    the artists appear at more than one event.

    So how do I create a query/relationship that will reflect this?

    Do I need to create an artistID field in my events table? If so, then how
    do I make multiple selections in that field (considering that more than one
    artist might appear at any one event).

    My problem is the same the other way around....if I create an eventID in the
    artists table, then how do I do the multiple selection?

    Thanks again,

    Nath.


    "Nathon Jones" <nathonjonesNOT@kirkmoor.com> wrote in message
    news:cvhuf2$52u$1@forums.macromedia.com...
    > Hi,
    > I'm working with Access/VBScript/ASP.
    >
    > I have an events table that has:
    >
    > eventID
    > venueID
    > eventname
    >
    > ...I also have a venues table that has
    >
    > venueID
    > venuename
    >
    > How do I create a recordset on a page, that will display the events, but
    > will also display the venue name, by matching the venueID in the events
    > table, with the venueID in the venues table?
    >
    > Got me stumped.
    >
    > Thanks.
    > Nath.
    >

    Nathon Jones Guest

  7. #6

    Default Re: one-to-many - how to display data from two tables?

    .oO(Nathon Jones)
    >I have an events table which has the following
    >
    >eventID
    >eventname
    >
    >...I have an artists table that has the following:
    >
    >artistID
    >artistname
    >
    >Some of the events have more than one artist appearing. Similarly, some of
    >the artists appear at more than one event.
    So you have a m:n (many-to-many) relationship.
    >So how do I create a query/relationship that will reflect this?
    You need a third table to connect both others. Assuming eventID and
    artistID are the primary keys, the third table would simply contain
    these both fields:

    eventID
    artistID

    For every combination of artist/event you simply insert a record into
    that table. Querying the three tables can be easily done with two
    (INNER) JOIN clauses.

    Micha
    Michael Fesser Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139