Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2006
    Posts
    157

    Unanswered: Add another column

    Hi: Can any one please tell me how to add one more column "user_view.User_Office_Location" in the query.
    Thanks.

    dbtr_view.assign_id=user_view.user_id

    ------
    select distinct(dbtr_view.debtor_id), dbtr_view.Next_Contact_Date,debt.clt_id, clt_ref_no, name1, name2, list_date, cur_bal, assign_id, dbtr_view.status_code, dbtr_view.status_date, dbtr_view.next_contact_date From dm.dbtr_view left outer join dm.debt on (debt.debt_id = dbtr_view.debtor_id,0) left outer join dm.pmt on (dbtr_view.debtor_id = pmt.debtor_id,0) where dbtr_view.assign_id in ('OXF') and list_date between '2007-02-06' and '2007-02-13' and (debt.clt_id like 'CINC01' ) and dbtr_view.status_code < '400'

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    put it in the list of columns you want to retrive from the SQL engine (so that'd be in the select component, before the FROM clause), if the column source isnt already part of the join in the query then you will need to add the join defintion as well (that'd be after the current last joind defintion and before the where clause
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jul 2006
    Posts
    157
    It gives synatx error on:
    inner join user_view.user_id = dbtr_view.assign_id

    select distinct(dbtr_view.debtor_id), dbtr_view.Next_Contact_Date,debt.clt_id, clt_ref_no, name1, name2, list_date, cur_bal,

    assign_id, dbtr_view.status_code, dbtr_view.status_date, dbtr_view.next_contact_date From dm.dbtr_view left outer join

    dm.debt on (debt.debt_id = dbtr_view.debtor_id,0) left outer join dm.pmt on (dbtr_view.debtor_id = pmt.debtor_id,0)
    inner join user_view.user_id = dbtr_view.assign_id
    where

    dbtr_view.assign_id in ('OXF') and list_date between '2007-02-06' and '2007-02-13' and (debt.clt_id like 'CINC01' ) and

    dbtr_view.status_code < '400'

Posting Permissions

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