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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Having a bit of trouble with this

Author  Topic 

brad_81x
Starting Member

8 Posts

Posted - 2013-07-18 : 05:13:12
Not too sure why I'm getting a multipart identifier error here.

Any thoughts?

select distinct
a.SofTrax_ID__c as [Softrax ID],
a.Unique_Id__c as [Salesforce ID],
uo.name [Owner],
a.Name as [Account Name],
a.Customer_Category__c as [Account Type],
rt.name [Account Record Type],
a.Class__c as [Class],
a.Primary_Country__c as [Primary Country],
a.Region__c as [Region],
a.Sub_Region__c as [Sub-Region],
a.D_B_SIC_1__c as [D&B SIC Code 1],
a.D_B_SIC_Desc_1__c as [D&B SIC Code Description],
a.D_B_Annual_Revenue__c as [D&B Annual Revenue],
a.D_B_of_Employees__c as [D&B Employees],
a.DUNS__c as [DUNS],
a.DU_DUNS__c as [DUDUNS],
a.Headquarter_DUNS__c as [Headquaters DUNS],
a.GU_DUNS__c as [GUDUNS],
a.Maintenance_Status__c as [Maintenance Status],
ip.Active_Flag__c as [Active Flag],
ip.Product_Line__c as [Product Line],
ip2.id [Product ID],
vwproduct2.SKU__c as [SKU]

from
vwAccount a
JOIN vwInstalled_Product_Line__c IP (Nolock) on a.id = ip.Account__c

LEFT JOIN salesforce_prod.dbo.RecordType rt (nolock) on a.RecordtypeID = rt.ID

left join vwInstalled_Product_Line__c IP2(nolock) on vwproduct2.id = ip2.id

LEFT Join gdw.dbo.vwUser UO (Nolock) ON a.ownerid = uo.id

where
a.SofTrax_ID__c not in ('NULL')
and
ip.Active_Flag__c in ('true')
and
a.Customer_Category__c in ('Customer','Holding Company','Prospect','Suspect')

order by 3,2

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2013-07-18 : 05:22:30
vwproduct2 ???


Too old to Rock'n'Roll too young to die.
Go to Top of Page

brad_81x
Starting Member

8 Posts

Posted - 2013-07-18 : 05:27:38
yeah i changed that round to

left join vwproduct2 prod (nolock) on ip.id = prod.id

but I'm still getting no joy
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-07-18 : 05:32:45
quote:
Originally posted by brad_81x

yeah i changed that round to

left join vwproduct2 prod (nolock) on ip.id = prod.id

but I'm still getting no joy


can you post exact error message?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -