Please assist me

  • I am new to T-SQL, my programmer gave me this query to run and I receive the error below. Please help.

    select profile.acct, date_appl_sent, date_appl_recd,

    CONVERT(char(100),DecryptByKey (enemail)) as email , rtrim(firstname) as 'firstname',

    rtrim(lastname) as 'lastname', ltrim(convert(char(4),productcode)) as productcode

    From BACKUPSQLSRV3.tradecs.dbo.profile inner join BACKUPSQLSRV3.trading.dbo.account

    on profile.acct = BACKUPSQLSRV3.trading.dbo.account.acct

    Where Convert(smalldatetime,date_appl_sent) =

    DateAdd(wk, -2, datename(month,getdate()) +str(datepart(day,getdate())) +str(datepart(year,getdate())))

    and date_appl_recd = ' ' and date_reminder_sent = ' ' and date_pen_appl_signed = ' '

    Server: Msg 4104, Level 16, State 1, Line 1

    The multi-part identifier "BACKUPSQLSRV3.trading.dbo.account.acct" could not be bound.

    Thanks

  • try using aliases in your FROM clause:

    From BACKUPSQLSRV3.tradecs.dbo.profile A1

    inner join BACKUPSQLSRV3.trading.dbo.account A2

    on A1.acct = A2.acct

    this is assuming you have working linked servers to the various systems...

  • Duplicate post. There are more answers here: http://www.sqlservercentral.com/Forums/Topic548448-146-1.aspx

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply