SQL Server Performance

Combining Columns from 2 different tables

Discussion in 'Getting Started' started by iluvlife114, Apr 14, 2011.

  1. iluvlife114 New Member

    Hello! I'm trying to combine several columns from 2 different tables, and I'm having trouble...
    When I run this report, it does what I want it to, and pulls the information that I need from the primary table. It gives me the right query to select date/time and everything.
    {$translate_lookup_exclusive|operator_his}
    SELECT operator_his.opr_activity_date, operator_his.opr_activity_time, operator_his.login_id, operator_his.employee, operator_his.record_desc, operator_his.xact_type, operator_his.table_id, operator_his.value, operator_his.facility
    FROM operator_his
    WHERE operator_his.table_id = 154 AND
    {$time_range_exclusive|report.DateAndTime|report.Operator|report.Host|report.UTC|opr_activity|host_activity|utc_activity} AND
    xact_type IN (9) AND
    (facility IN (33,31,20,17,39,19,38,37,35,15,-1,4,10,34,21,8,30,23,1,25,2,12,24,36,32,27,9,22,28,26) OR facility IS NULL)
    What I'm trying to add to this is the final report is the field badge_history.employee from the table badge_history. I tried adding it to the SQL that works, but it continues to give me an error every time. I think I'm just putting it together wrong or something...
    Any suggestions would be GREATLY appreciated!
  2. FrankKalis Moderator

    Welcome to the forum!
    If the problem still persists, please post the actual error you get, along with your query that caused it.

Share This Page