22. August 2012 17:07
Inner Exception: System.Data.SqlClient.SqlException: Invalid column name 'AccountId'.
WITH __QuickFind__ as (select top 10001 [AccountId] from (
SELECT "account0".[ParentId] from [CustomerAddressBase] as "account0" where ("account0".Line1 like 'test%' and "account0".AddressNumber = 1 and "account0".ObjectTypeCode = 1) OR ("account0".City like 'test%' and "account0".AddressNumber = 1 and "account0".ObjectTypeCode = 1) UNION
SELECT "account0".[AccountId] from [AccountBase] as "account0" where ("account0".EMailAddress1 like 'test%') OR ("account0".Name like 'test%') UNION
SELECT "account0".[AccountId] from [AccountExtensionBase] as "account0" where ("account0".New_DebitorNumber like 'test%') UNION
SELECT "account0".[AccountId] from [AccountBase] as "account0" where "account0".ParentAccountId in (select [AccountId] from [AccountBase] as "account0" where "account0".Name like 'test%')) as [__QuickFindInternal__])select
top 251 "account0".Name as "name"
, "account0".Address1_City as "address1_city"
, "account0".Address1_Line1 as "address1_line1"
, "account0".New_address1_country as "new_address1_country"
, "account0".ParentAccountId as "parentaccountid"
, "account0".Address1_PostalCode as "address1_postalcode"
, "account0".new_industrycodeid as "new_industrycodeid"
, "account0".New_DebitorNumber as "new_debitornumber"
, "account0".WebSiteURL as "websiteurl"
, "account0".AccountId as "accountid"
, "account0".ParentAccountIdYomiName as "parentaccountidyominame"
, "account0".ParentAccountIdName as "parentaccountidname"
, "account0".new_industrycodeidName as "new_industrycodeidname"
, case when (select COUNT(*) from [__QuickFind__]) = 10001 then 1 else 0 end as [__QuickFindLimitValue__]
from
Account as "account0" (NOLOCK)
where
[account0].[AccountId] in (select [AccountId] from [__QuickFind__]) and ((((("account0".StatusCode != 2 or "account0".StatusCode is null))))) order by
"account0".Name asc
, "account0".AccountId asc
22. August 2012 17:32