Announcement

Collapse
No announcement yet.

Selecting two or more tables

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Selecting two or more tables

    I have a customer and some more tables with different data sets related to the customers.

    How can I display grids and forms that show all the customer's data table together with the related data from another table in grids and pdf reports?
    Do I have to generate a foreign key for every field to display from another table?

    It might be easy, but I'm a beginner :-)

    Joe

  • #2
    Let's assume you have a customer table where every customer has its own customer id.
    Then you have an orders table where every order has its own order id but in order to know which order belongs to which customer
    you need a field in the orders table with the customer id. That is your foreign key. You don't have to generate a foreign key, you just put
    the customer's id in the respective field in the orders table when ever you create a new order.
    Now you can say:
    Show me customer xyz from the customer table and all orders from the order table with the same customer id.
    If this concept is somewhat new to you, I suggest you grab a six pack and start reading. :-)

    jsb

    Comment


    • #3
      Thanks jsbinca,

      do I have to write these queries manually (SQL Builder) or can they be generated automatically in SC?

      Joe

      Comment


      • #4
        OK - I think I got it with master/detail

        Joe

        Comment

        Working...
        X