#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Posts
    7
    Rep Power
    0

    query help needed


    I have these tables:

    level_logg
    Level_Logg_Timestamp
    Tank_ID<FK>

    tank
    Tank_ID
    Pejl_ID<FK>

    pejl
    Pejl_ID
    Pejl_Placement_ID<FK>
    Customer_Number<FK>

    pejl_placement
    Pejl_Placement_ID
    Placement_Name

    customer
    Customer_Number
    Customer_Name

    I'm trying to make a query the that I get the folowing result:

    Pejl_ID
    Customer_Name
    Placement_Name
    Level_Logg_Timestamp


    I need some help to get this right, I have no problem gettting everything except the timestamp there I don't know how to do.

    plz help

    .patrik
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Cincinnati, OH USA
    Posts
    111
    Rep Power
    12
    You could post what you have so far... but basically from what I've read I would use something like this:

    SELECT pejl.pejl_id, customer.customer_Name, pejl_placement.placement_Name, level_logg.level_logg_timestamp
    FROM level_logg
    INNER JOIN tank ON level_logg.tank_id = tank.tank_id
    INNER JOIN pejl ON tank.pejl_id = pejl.pejl_id
    INNER JOIN pejl_placement ON pejl.pejl_placement_id = pejl_placement.pejl_placement_id
    INNER JOIN customer ON pejl.customer_number = customer.customer_number


    It seems from what you wrote that this are all 1 to 1 relationships, I think. Try that.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Posts
    7
    Rep Power
    0
    thx worked lika a charm! had been thinking a little wrong...

    .p

IMN logo majestic logo threadwatch logo seochat tools logo