Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
KRichradson1127
Starting Member
20 Posts |
Posted - 2009-08-04 : 15:33:19
|
| Hello all...I'm in the midst of working on the following coding, piece-by-piece:selectdistinct c.name as 'Company Name',ss.name as 'Program',a.application_number as 'Application Number',a.sites as 'Site Count',convert(varchar(10), a.accreditation_start_date, 101) as 'Start of Accreditation',convert(varchar(10), aag.app_submission_due_date, 101) as 'App Due Date','' as 'Previous Accreditation Fee Paid','' as 'POS Cycle',(i.firstname + ' ' + i.lastname) as 'Primary Contact','' as 'Primary Contact Email','' as 'Primary Contact Title', LTRIM((select i.firstName from individual i where i.individualid = aag.am_id_mysql)) + ' ' + RTRIM((select i.lastName from individual i where aag.am_id_mysql = i.individualid)) as 'Account Manager',ast.application_status_description as 'Status',convert(varchar(10), a.accreditation_expiration, 101) as 'Expiration Date',(select convert(varchar(10),asl.user_date, 101)) as 'AC Decision Date'from[application] ajoin accreditation_agreement aag on a.client_id = aag.company_idinner join company c on a.company_id_mysql = c.companyidinner join application_accreditation aa on a.application_id = aa.application_id inner join standard_set ss on aa.standard_set_id = ss.standard_set_id inner join application_status_log asl on a.application_id = asl.application_idinner join application_status ast on asl.status = ast.application_status_idUpon executing the query, I get the following error which is reflected off of the bolded area:Msg 4104, Level 16, State 1, Line 1The multi-part identifier "i.firstname" could not be bound.Msg 4104, Level 16, State 1, Line 1The multi-part identifier "i.lastname" could not be bound. Can anyone fix this for me? I don't understand what is wrong...THANKS IN ADVANCE |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-08-04 : 15:40:14
|
The error is not the bolded part. The error is three lines above!select distinct c.name as [Company Name], ss.name as Program, a.application_number as [Application Number], a.sites as [Site Count], convert(varchar(10), a.accreditation_start_date, 101) as [Start of Accreditation], convert(varchar(10), aag.app_submission_due_date, 101) as [App Due Date], '' as [Previous Accreditation Fee Paid], '' as [POS Cycle], i.firstname + ' ' + i.lastname as [Primary Contact], '' as [Primary Contact Email], '' as [Primary Contact Title], LTRIM(i.firstName) + ' ' + RTRIM(i.lastName) as [Account Manager], ast.application_status_description as [Status], convert(varchar(10), a.accreditation_expiration, 101) as [Expiration Date], convert(varchar(10), asl.user_date, 101) as [AC Decision Date]from [application] AS ainner join accreditation_agreement as aag on a.client_id = aag.company_idinner join company as c on a.company_id_mysql = c.companyidinner join application_accreditation as aa on a.application_id = aa.application_id inner join standard_set as ss on aa.standard_set_id = ss.standard_set_id inner join application_status_log as asl on a.application_id = asl.application_idinner join application_status as ast on asl.status = ast.application_status_idleft join individual AS i on i.individualid = aag.am_id_mysql N 56°04'39.26"E 12°55'05.63" |
 |
|
|
KRichradson1127
Starting Member
20 Posts |
Posted - 2009-08-04 : 15:41:03
|
| Oh....I must have overlooked that part...Thanks! |
 |
|
|
|
|
|
|
|